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

Test failures on openSUSE 15.1: AssertionError: Explicit other_table and other_column #74

Open
jayvdb opened this issue Jan 7, 2020 · 3 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Jan 7, 2020

openSUSE 15.1 is using python 3.6.5 and click-7.0 , however it has test failures while openSUSE Tumbleweed on py37 passes.

Most fail on the cli exit code like

[   74s] =================================== FAILURES ===================================
[   74s] _________________________________ test_tables __________________________________
[   74s] 
[   74s] db_path = '/tmp/pytest-of-abuild/pytest-0/test_tables0/test.db'
[   74s] 
[   74s]     def test_tables(db_path):
[   74s]         result = CliRunner().invoke(cli.cli, ["tables", db_path])
[   74s] >       assert '[{"table": "Gosh"},\n {"table": "Gosh2"}]' == result.output.strip()
[   74s] E       assert '[{"table": "...e": "Gosh2"}]' == ''
[   74s] E         - [{"table": "Gosh"},
[   74s] E         -  {"table": "Gosh2"}]
[   74s] 
[   74s] tests/test_cli.py:28: AssertionError

packaging project at https://build.opensuse.org/package/show/home:jayvdb:py-new/python-sqlite-utils

I'll keep digging into this after I have github-to-sqlite working on Tumbleweed, as I'll need openSUSE Leap 15.1 working before I can submit this into the main python repo.

@simonw
Copy link
Owner

simonw commented Jan 10, 2020

This is odd. I'd love to see more about that result object.

Could you try running pytest --pdb and then result.exit_code, result.exception in the PDB prompt, something like this?

$ pytest --pdb
========================================================= test session starts =========================================================
platform darwin -- Python 3.7.4, pytest-5.2.2, py-1.8.0, pluggy-0.13.0
rootdir: /Users/simonw/Dropbox/Development/sqlite-utils
plugins: cov-2.8.1
collected 216 items                                                                                                                   

tests/test_black.py s                                                                                                           [  0%]
tests/test_cli.py F
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

db_path = '/private/var/folders/bl/5x847xbj2yb7xmp7f2tz7l280000gn/T/pytest-of-simonw/pytest-3/test_tables0/test.db'

    def test_tables(db_path):
        result = CliRunner().invoke(cli.cli, ["tables1", db_path])
>       assert '[{"table": "Gosh"},\n {"table": "Gosh2"}]' == result.output.strip()
E       assert '[{"table": "...e": "Gosh2"}]' == ''
E         - [{"table": "Gosh"},
E         -  {"table": "Gosh2"}]

tests/test_cli.py:28: AssertionError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /Users/simonw/Dropbox/Development/sqlite-utils/tests/test_cli.py(28)test_tables()
-> assert '[{"table": "Gosh"},\n {"table": "Gosh2"}]' == result.output.strip()
(Pdb) result.exit_code, result.exception
(1, OperationalError('near "/": syntax error'))

That should show the exception that caused the script to fail to run.

@jayvdb
Copy link
Contributor Author

jayvdb commented Jan 12, 2020

Thanks. That showed me that there was a click cli runner error, and setting export LANG=en_US.UTF-8 fixed it.

@jayvdb
Copy link
Contributor Author

jayvdb commented Jan 12, 2020

I guess there is some extra flag for CliRunner.invoke to check exitcode and raise the exception, or that should be an extra assert added.

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

2 participants