mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-25 07:44:37 +03:00
Fix About Paint dialog test failing due to version string changes
Make version info static when running in pytest. I also tried adding in test_snapshots.py: import textual_paint textual_paint.__version__ = "snapshot test edition 1" import textual_paint.__init__ as init init.__version__ = "snapshot test edition 2" which seemed to have no effect. Since I already have special case logic for __version__ in __init__.py, I'm reasonably happy with this solution.
This commit is contained in:
parent
9f12ba7833
commit
2e89e73f37
@ -17,5 +17,14 @@ from subprocess import check_output
|
||||
DEVELOPMENT = exists(dirname(__file__) + "/../../.git")
|
||||
"""Whether running from a Git repository."""
|
||||
|
||||
import sys
|
||||
|
||||
PYTEST = "pytest" in sys.modules
|
||||
"""Whether running from pytest."""
|
||||
|
||||
if DEVELOPMENT:
|
||||
__version__ = "development " + check_output(["git", "describe", "--tags"], cwd=dirname(__file__)).strip().decode()
|
||||
|
||||
if PYTEST:
|
||||
# Avoid version string in About Paint dialog affecting snapshots.
|
||||
__version__ = "snapshot test edition :)"
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user