diff options
author | Ronny Pfannschmidt <opensource@ronnypfannschmidt.de> | 2018-05-23 16:48:46 +0200 |
---|---|---|
committer | Ronny Pfannschmidt <opensource@ronnypfannschmidt.de> | 2018-05-23 16:48:46 +0200 |
commit | 703e4b11ba76171eccd3f13e723c47b810ded7ef (patch) | |
tree | 1d573c62db1f5d876360a0793891eb4d6103f635 /testing/freeze | |
parent | 3e1590bcfcce1a28619abc31425f407cb0459b75 (diff) | |
download | pytest-703e4b11ba76171eccd3f13e723c47b810ded7ef.tar.gz |
run black
Diffstat (limited to 'testing/freeze')
-rw-r--r-- | testing/freeze/create_executable.py | 8 | ||||
-rw-r--r-- | testing/freeze/runtests_script.py | 3 | ||||
-rw-r--r-- | testing/freeze/tests/test_trivial.py | 5 | ||||
-rw-r--r-- | testing/freeze/tox_run.py | 10 |
4 files changed, 13 insertions, 13 deletions
diff --git a/testing/freeze/create_executable.py b/testing/freeze/create_executable.py index f4f6088ef..98aa2034c 100644 --- a/testing/freeze/create_executable.py +++ b/testing/freeze/create_executable.py @@ -1,12 +1,12 @@ """ Generates an executable with pytest runner embedded using PyInstaller. """ -if __name__ == '__main__': +if __name__ == "__main__": import pytest import subprocess hidden = [] for x in pytest.freeze_includes(): - hidden.extend(['--hidden-import', x]) - args = ['pyinstaller', '--noconfirm'] + hidden + ['runtests_script.py'] - subprocess.check_call(' '.join(args), shell=True) + hidden.extend(["--hidden-import", x]) + args = ["pyinstaller", "--noconfirm"] + hidden + ["runtests_script.py"] + subprocess.check_call(" ".join(args), shell=True) diff --git a/testing/freeze/runtests_script.py b/testing/freeze/runtests_script.py index d281601c0..d03bca840 100644 --- a/testing/freeze/runtests_script.py +++ b/testing/freeze/runtests_script.py @@ -3,7 +3,8 @@ This is the script that is actually frozen into an executable: simply executes py.test main(). """ -if __name__ == '__main__': +if __name__ == "__main__": import sys import pytest + sys.exit(pytest.main()) diff --git a/testing/freeze/tests/test_trivial.py b/testing/freeze/tests/test_trivial.py index 45622b850..08a55552a 100644 --- a/testing/freeze/tests/test_trivial.py +++ b/testing/freeze/tests/test_trivial.py @@ -1,7 +1,6 @@ - def test_upper(): - assert 'foo'.upper() == 'FOO' + assert "foo".upper() == "FOO" def test_lower(): - assert 'FOO'.lower() == 'foo' + assert "FOO".lower() == "foo" diff --git a/testing/freeze/tox_run.py b/testing/freeze/tox_run.py index 3fc388040..678a69c85 100644 --- a/testing/freeze/tox_run.py +++ b/testing/freeze/tox_run.py @@ -2,11 +2,11 @@ Called by tox.ini: uses the generated executable to run the tests in ./tests/ directory. """ -if __name__ == '__main__': +if __name__ == "__main__": import os import sys - executable = os.path.join(os.getcwd(), 'dist', 'runtests_script', 'runtests_script') - if sys.platform.startswith('win'): - executable += '.exe' - sys.exit(os.system('%s tests' % executable)) + executable = os.path.join(os.getcwd(), "dist", "runtests_script", "runtests_script") + if sys.platform.startswith("win"): + executable += ".exe" + sys.exit(os.system("%s tests" % executable)) |