Commit 98703910 authored by J. Fernando Sánchez's avatar J. Fernando Sánchez
Browse files

Run tests from gsiupm/senpy

parent 9bea267f
......@@ -70,8 +70,13 @@ dev: dev-$(PYMAIN)
test-all: $(addprefix test-,$(PYVERSIONS))
# Run from in an isolated container, built from the base image.
# This speeds tests up because the image has most (if not all) of the dependencies already.
docker run --rm --entrypoint /usr/local/bin/python -v $(PWD):/usr/src/app -w /usr/src/app $(IMAGENAME):python$* test
docker rm $(NAME)-test-$* || true
docker create -ti --name $(NAME)-test-$* --entrypoint="" -w /usr/src/app/ $(IMAGENAME):python$* python test
docker cp . $(NAME)-test-$*:/usr/src/app
docker start -a $(NAME)-test-$*
test: test-$(PYMAIN)
......@@ -69,6 +69,10 @@ class Plugin(models.Plugin):
def test(self):
if not hasattr(self, 'test_cases'):
import inspect
raise AttributeError(('Plugin {} [{}] does not have any defined '
'test cases').format(, inspect.getfile(self.__class__)))
for case in self.test_cases:
res = list(self.analyse_entry(models.Entry(case['entry']),
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment