forked from seba/servefile
Workaround for python2 deprecation in tests
When checking the version the test now gets a CryptographyDeprecationWarning plus an import code line instead of the version. As a workaround we now ignore the first two lines when checking for the version string.
This commit is contained in:
parent
19c1b000a4
commit
ef41f65996
|
@ -97,6 +97,12 @@ def _test_version(run_servefile, standalone):
|
||||||
s.wait()
|
s.wait()
|
||||||
version = s.stdout.readline().decode().strip()
|
version = s.stdout.readline().decode().strip()
|
||||||
|
|
||||||
|
# python2 is deprecated, but we still want our tests to run for it
|
||||||
|
# CryptographyDeprecationWarnings get in the way for this
|
||||||
|
if 'CryptographyDeprecationWarning' in version:
|
||||||
|
s.stdout.readline() # ignore "from x import y" line
|
||||||
|
version = s.stdout.readline().decode().strip()
|
||||||
|
|
||||||
# hardcode version as string until servefile is a module
|
# hardcode version as string until servefile is a module
|
||||||
assert version == 'servefile 0.4.4'
|
assert version == 'servefile 0.4.4'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue