Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scoped pytest fixture are not invoked for sql tests #15

Open
lmergner opened this issue May 30, 2020 · 0 comments
Open

scoped pytest fixture are not invoked for sql tests #15

lmergner opened this issue May 30, 2020 · 0 comments
Assignees

Comments

@lmergner
Copy link
Owner

It looks like scoped fixtures are not run for sql tests. This
affects fixtures that should be run per-function, etc. Tests
pass when setup/teardown is done at the "session" level, but
fail when the table creation scope changes to per-function.


============================= test session starts ==============================
platform darwin -- Python 3.8.2, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
pgTap Connection: postgresql://contrivers:blarg@192.168.1.72:5432/pestle
pgTap Schema: None
rootdir: /Users/lmerg/code/pestle, inifile: setup.cfg, testpaths: tests
plugins: cov-2.9.0, pgtap-0.1.0
collected 2 items

tests/test_models.py .                                                   [ 50%]
tests/test_schema.sql F                                                  [100%]

=================================== FAILURES ===================================
____________________________ pgTap test_schema.sql _____________________________
1..12
not ok 1 - Should have 3 tables
# Failed test 1: "Should have 3 tables"
#     Missing tables:
#         post
#         simple
#         "user"
not ok 2 - table simple should have 4 basic colums
# Failed test 2: "table simple should have 4 basic colums"
#     Missing columns:
#         created
#         extras
#         modified
#         oid
not ok 3 - Column simple.extras should be type json
# Failed test 3: "Column simple.extras should be type json"
#    Column simple.extras does not exist
not ok 4 - table post should have a text column
# Failed test 4: "table post should have a text column"
not ok 5 - table post should have a tsvector column
# Failed test 5: "table post should have a tsvector column"
not ok 6 - table post shouldhave a tsvector column with type tsvector
# Failed test 6: "table post shouldhave a tsvector column with type tsvector"
#    Column post.tsvector does not exist
not ok 7 - table post should have an index on the tsvector column
# Failed test 7: "table post should have an index on the tsvector column"
not ok 8 - table post should have a trigger
# Failed test 8: "table post should have a trigger"
not ok 9 - table user should have a password column
# Failed test 9: "table user should have a password column"
not ok 10 - table user should have a password updated column
# Failed test 10: "table user should have a password updated column"
not ok 11 - Column "user".password_updated should be type timestamp with time zone
# Failed test 11: "Column "user".password_updated should be type timestamp with time zone"
#    Column "user".password_updated does not exist
not ok 12 - table user col token should be unique
# Failed test 12: "table user col token should be unique"
#         have: 
#         want: {token}
# Looks like you failed 12 tests of 12

=============================== warnings summary ===============================
/Users/lmerg/.pyenv/versions/pestle/lib/python3.8/site-packages/_pytest/junitxml.py:417
  /Users/lmerg/.pyenv/versions/pestle/lib/python3.8/site-packages/_pytest/junitxml.py:417: PytestDeprecationWarning: The 'junit_family' default value will change to 'xunit2' in pytest 6.0.
  Add 'junit_family=xunit1' to your pytest.ini file to keep the current format in future versions of pytest and silence this warning.
    _issue_warning_captured(deprecated.JUNIT_XML_DEFAULT_FAMILY, config.hook, 2)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
- generated xml file: /var/folders/tj/sz8275nx2kj4czqq2qsqlwf40000gn/T/tmp-51492xvtYl7kjoN59.xml -

---------- coverage: platform darwin, python 3.8.2-final-0 -----------
Name                 Stmts   Miss  Cover
----------------------------------------
pestle/__init__.py       4      0   100%
pestle/__main__.py      22     22     0%
pestle/models.py        55     14    75%
pestle/schemas.py       47     47     0%
pestle/session.py       41     41     0%
----------------------------------------
TOTAL                  169    124    27%
Coverage HTML written to dir htmlcov

=========================== short test summary info ============================
FAILED tests/test_schema.sql
==================== 1 failed, 1 passed, 1 warning in 2.10s ====================
@lmergner lmergner self-assigned this May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant