Fix running_in_docker() check failing on newer Docker

This test has to work to ensure spoof/tesseract_cache.py has a writable
directory to put cache into. Otherwise those tests fail.
This commit is contained in:
James R. Barlow
2017-02-13 02:16:06 -08:00
parent c9a83afad6
commit 9f800736bc
+3 -2
View File
@@ -24,8 +24,9 @@ def is_linux():
@pytest.helpers.register
def running_in_docker():
# Docker creates a file named /.dockerinit
return os.path.exists('/.dockerinit')
# Docker creates a file named /.dockerenv (newer versions) or
# /.dockerinit (older) -- this is undocumented, not an offical test
return os.path.exists('/.dockerenv') or os.path.exists('/.dockerinit')
TESTS_ROOT = os.path.abspath(os.path.dirname(__file__))