Skip to content

TST: psycopg2 errors when running tests locally #24485

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

Closed
jbrockmendel opened this issue Dec 29, 2018 · 8 comments · Fixed by #24492
Closed

TST: psycopg2 errors when running tests locally #24485

jbrockmendel opened this issue Dec 29, 2018 · 8 comments · Fixed by #24492
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@jbrockmendel
Copy link
Member

I just started noticing these (167 of them) in the logs from python -m pytest pandas/tests --skip-slow

_____________________________ ERROR at setup of TestPostgreSQLAlchemyConn.test_read_sql[load_iris_data0] ______________________________

cls = <pandas.tests.io.test_sql.TestPostgreSQLAlchemyConn object at 0x7f2843ab4a50>

    @pytest.fixture(autouse=True, scope='class')
    def setup_class(cls):
        cls.setup_import()
        cls.setup_driver()
        conn = cls.connect()
>       conn.connect()

[...]
>       conn = _connect(dsn, connection_factory=connection_factory, async=async)
E       OperationalError: (psycopg2.OperationalError) fe_sendauth: no password supplied

../../.local/lib/python2.7/site-packages/psycopg2/__init__.py:164: OperationalError
@jbrockmendel
Copy link
Member Author

Looking at setup.cfg, I guess I'm supposed to start specifying --skip-db too?

@TomAugspurger
Copy link
Contributor

Skipping should probably be the default, right @datapythonista?

@datapythonista
Copy link
Member

I thought about it, but as pymysql and psycopg are not in environment.yml, I didn't see a difference, as the tests should be skipped anyway.

Happy to change it, I don't have a preference.

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Dec 29, 2018 via email

@datapythonista
Copy link
Member

ok, will open a PR

@gfyoung gfyoung added the Testing pandas testing functions or related to the test suite label Dec 30, 2018
@jreback jreback added this to the 0.24.0 milestone Dec 30, 2018
@jbrockmendel
Copy link
Member Author

So I'm now getting 242 errors, at runtime, most/all of which appear to be in pandas/tests/io/test_sql.py. The error message I'm seeing is weird:

______________________________ ERROR at setup of TestSQLiteAlchemyConn.test_transactions[load_iris_data0] _______________________________

item = <Function 'test_transactions[load_iris_data0]'>

    def pytest_runtest_setup(item):
        if 'slow' in item.keywords and item.config.getoption("--skip-slow"):
            pytest.skip("skipping due to --skip-slow")
    
        if 'slow' not in item.keywords and item.config.getoption("--only-slow"):
            pytest.skip("skipping due to --only-slow")
    
        if 'network' in item.keywords and item.config.getoption("--skip-network"):
            pytest.skip("skipping due to --skip-network")
    
        if 'high_memory' in item.keywords and not item.config.getoption(
                "--run-high-memory"):
            pytest.skip(
                "skipping high memory test since --run-high-memory was not set")
    
        # if "db" not explicitly set in the -m pattern, we skip the db tests
        if 'db' in item.keywords:
            pattern = item.config.getoption('-m')
            markers = collections.defaultdict(bool)
            for marker in item.iter_markers():
                markers[marker.name] = True
            markers['db'] = False
>           db_in_pattern = not eval(pattern, {}, markers)
E             File "<string>", line 0
E               
E              ^
E           SyntaxError: unexpected EOF while parsing

pandas/conftest.py:70: SyntaxError

Any chance this is related to #24492?

@datapythonista
Copy link
Member

Sorry. Yes, just realized now. I tested it with different values for the -m parameter, but didn't test when -m is not provided (and the CI also has it).

Will open a PR soon.

@datapythonista
Copy link
Member

Opened #24513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants