Skip to content

Commit cd31d7e

Browse files
authored
Merge pull request #4884 from wlemkows/py-cache-disable
test: disable bytecode on module import (py)
2 parents 3a77b8f + 3868006 commit cd31d7e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/test/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ clean clobber: $(TESTS_BUILD)
370370
$(RM) *.$(SYNC_EXT)
371371
$(RM) $(FILE_MAX_DAX_DEVICES)
372372
$(RM) envconfig.sh envconfig.py
373-
$(RM) -r __pycache__ */__pycache__
374373

375374
$(TESTS) $(OBJ_DEPS) $(LIBPMEMPOOL_DEPS) $(LIBPMEMPOOL_MOD_DEPS): $(TEST_DEPS)
376375

src/test/testframework.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
import sys
88
from os import path
9+
10+
# Don't create cache files on the import of test modules.
11+
# Improvement using bytecode in python tf code is insignificant.
12+
# It is workaround for a pycache clobber issue in our tangled Makefiles.
13+
sys.dont_write_bytecode = True
914
sys.path.insert(1, path.abspath(path.join(path.dirname(__file__), 'unittest')))
1015

1116
# flake8 issues silenced:

0 commit comments

Comments
 (0)