From 634be005a2f6a5ceac9e799b8e4baf8cffc9d913 Mon Sep 17 00:00:00 2001 From: Stefane Fermigier Date: Wed, 2 Aug 2017 11:29:33 +0200 Subject: [PATCH] Work on tests and infra. --- Makefile | 8 +++++--- TODO.md | 11 +++++++++++ TODO.txt | 6 ------ abilian/core/models/tests/test_blob.py | 6 ++---- tox.ini | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 TODO.md delete mode 100644 TODO.txt diff --git a/Makefile b/Makefile index d48a86ec..1562b534 100644 --- a/Makefile +++ b/Makefile @@ -5,12 +5,14 @@ SRC=abilian # The package name PKG=abilian -# On a 4 core laptop, 2 is optimal -NCPU=2 +# FIXME: We have a parallelism issue with soffice conversion +# NCPU ?= $(shell sysctl -n hw.ncpu || echo 1) +NCPU=1 # pytest-sugar seems to be incompatible with pytest-xdist # -s: no terminal capture. -PYTEST_MULTI=-n $(NCPU) -p no:sugar -s +# PYTEST_MULTI=-n $(NCPU) -p no:sugar -s +PYTEST_MULTI=-n $(NCPU) all: test lint diff --git a/TODO.md b/TODO.md new file mode 100644 index 00000000..85ad4284 --- /dev/null +++ b/TODO.md @@ -0,0 +1,11 @@ +# TODO + +## Python 3 & deps upgrades + +- [] Upgrade Flaks-WTF to 0.13 and fix metaclass error +- [] Ugrade flask-sqlalchemy and other SQLA releated deps +- [] Fix all tests (including skipped ones) under Python 3.6 + +## Other + +See: diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index 02bc5cc3..00000000 --- a/TODO.txt +++ /dev/null @@ -1,6 +0,0 @@ - -Deps: - -- Upgrade Flaks-WTF to 0.13 and fix metaclass error -- Run under Python 3.5 and 3.6 - diff --git a/abilian/core/models/tests/test_blob.py b/abilian/core/models/tests/test_blob.py index c2036014..1b866079 100644 --- a/abilian/core/models/tests/test_blob.py +++ b/abilian/core/models/tests/test_blob.py @@ -107,10 +107,8 @@ def test_value(self): session.delete(b) # object marked for deletion, but instance attribute should still be # readable - assert session_repository.get( - b, - b.uuid, - ).open('rb').read() == content + fd = session_repository.get(b, b.uuid, ).open('rb') + assert fd.read() == content # commit in transaction: session_repository has no content, 'physical' # repository still has content diff --git a/tox.ini b/tox.ini index c17a3dd0..72ee50e8 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ commands = pip install -e .[dev] # Run tests - py.test --tb=short --junitxml=junit-{envname}.xml abilian tests + py.test --tb=short --junitxml=junit-{envname}.xml . # Run lint make lint-ci