Closed susht3 closed 5 years ago
yeap,i know how to test, i run "python -m pytest.ini", but it seems not to register the predictor, because i get this error:
allennlp.common.checks.ConfigurationError: 'bidaf_baseline is not a registered name for Predictor'
but i have register bidaf_baseline in my code:
@Predictor.register('bidaf_baseline') class BidafPredictor(Predictor):
In your test file, you need to be sure you import the class before trying to use it through the registry, otherwise you'll get that error.
In your test file, you need to be sure you import the class before trying to use it through the registry, otherwise you'll get that error.
thanks a lot, i import the class then i can run it, but now i get a new error that the test file is killed:
Python 3.6.2, pytest-3.8.2, py-1.6.0, pluggy-0.7.1
rootdir: /data1/susht3/workspace/allen, inifile: pytest.ini
code/tests/models/my_bidaf_test.py FKilled
my_bidaf_test.py is copy from allennlp and change the filename
@susht3 it looks like your first test failed (see the F
in FKilled
). Hopefully the exception is tracked elsewhere.
@susht3 it seems like you've moved on from this, but please do re-open if you have additional context (such as the exception that killed your tests).
i implement some test utils for my predictors, but i do not know how to use the test class