mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
fix #2470
This commit is contained in:
parent
00b80b33a1
commit
dd7902cf7f
@ -60,5 +60,5 @@ def get_version(dev: bool = False, build: bool = False, refresh: bool = False) -
|
|||||||
return mitmproxy_version
|
return mitmproxy_version
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__": # pragma: no cover
|
||||||
print(VERSION)
|
print(VERSION)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import pathlib
|
||||||
import runpy
|
import runpy
|
||||||
import subprocess
|
import subprocess
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
@ -6,7 +7,9 @@ from mitmproxy import version
|
|||||||
|
|
||||||
|
|
||||||
def test_version(capsys):
|
def test_version(capsys):
|
||||||
runpy.run_module('mitmproxy.version', run_name='__main__')
|
here = pathlib.Path(__file__).absolute().parent
|
||||||
|
version_file = here / ".." / ".." / "mitmproxy" / "version.py"
|
||||||
|
runpy.run_path(str(version_file), run_name='__main__')
|
||||||
stdout, stderr = capsys.readouterr()
|
stdout, stderr = capsys.readouterr()
|
||||||
assert len(stdout) > 0
|
assert len(stdout) > 0
|
||||||
assert stdout.strip() == version.VERSION
|
assert stdout.strip() == version.VERSION
|
||||||
|
Loading…
Reference in New Issue
Block a user