2020-06-17 08:47:54 +00:00
|
|
|
Index: sh-1.13.1/sh.py
|
|
|
|
===================================================================
|
|
|
|
--- sh-1.13.1.orig/sh.py
|
|
|
|
+++ sh-1.13.1/sh.py
|
|
|
|
@@ -3785,14 +3785,9 @@ if __name__ == "__main__": # pragma: no
|
2019-02-01 13:32:19 +00:00
|
|
|
|
2020-06-17 08:47:54 +00:00
|
|
|
if action in ("test", "travis", "tox"):
|
2019-02-01 13:32:19 +00:00
|
|
|
import test
|
|
|
|
- coverage = None
|
|
|
|
- if test.HAS_UNICODE_LITERAL:
|
|
|
|
- import coverage
|
|
|
|
|
|
|
|
env = os.environ.copy()
|
|
|
|
env["SH_TESTS_RUNNING"] = "1"
|
|
|
|
- if coverage:
|
|
|
|
- test.append_module_path(env, coverage)
|
|
|
|
|
|
|
|
# if we're testing locally, run all versions of python on the system
|
|
|
|
if action == "test":
|
2020-06-17 08:47:54 +00:00
|
|
|
Index: sh-1.13.1/test.py
|
|
|
|
===================================================================
|
|
|
|
--- sh-1.13.1.orig/test.py
|
|
|
|
+++ sh-1.13.1/test.py
|
|
|
|
@@ -6,34 +6,6 @@ IS_PY3 = sys.version_info[0] == 3
|
2019-02-01 13:32:19 +00:00
|
|
|
IS_PY2 = not IS_PY3
|
|
|
|
MINOR_VER = sys.version_info[1]
|
|
|
|
|
|
|
|
-# coverage doesn't work in python 3.1, 3.2 due to it just being a shit
|
|
|
|
-# python
|
|
|
|
-HAS_UNICODE_LITERAL = not (IS_PY3 and MINOR_VER in (1, 2))
|
|
|
|
-
|
|
|
|
-cov = None
|
|
|
|
-if HAS_UNICODE_LITERAL:
|
|
|
|
- run_idx = int(os.environ.pop("SH_TEST_RUN_IDX", "0"))
|
|
|
|
- first_run = run_idx == 0
|
|
|
|
-
|
2020-06-17 08:47:54 +00:00
|
|
|
- try:
|
|
|
|
- import coverage
|
|
|
|
- except ImportError:
|
|
|
|
- pass
|
|
|
|
- else:
|
|
|
|
- # for some reason, we can't run auto_data on the first run, or the coverage
|
|
|
|
- # numbers get really screwed up
|
|
|
|
- auto_data = True
|
|
|
|
- if first_run:
|
|
|
|
- auto_data = False
|
2019-02-01 13:32:19 +00:00
|
|
|
-
|
2020-06-17 08:47:54 +00:00
|
|
|
- cov = coverage.Coverage(auto_data=auto_data)
|
2019-02-01 13:32:19 +00:00
|
|
|
-
|
2020-06-17 08:47:54 +00:00
|
|
|
- if first_run:
|
|
|
|
- cov.erase()
|
2019-02-01 13:32:19 +00:00
|
|
|
-
|
2020-06-17 08:47:54 +00:00
|
|
|
- cov.start()
|
2019-02-01 13:32:19 +00:00
|
|
|
-
|
|
|
|
-
|
|
|
|
from os.path import exists, join, realpath, dirname, split
|
|
|
|
import unittest
|
|
|
|
try:
|
2020-06-17 08:47:54 +00:00
|
|
|
@@ -3230,6 +3202,4 @@ if __name__ == "__main__":
|
2019-02-01 13:32:19 +00:00
|
|
|
exit(1)
|
|
|
|
|
|
|
|
finally:
|
|
|
|
- if cov:
|
|
|
|
- cov.stop()
|
|
|
|
- cov.save()
|
|
|
|
+ pass
|