On Fri, Apr 12, 2019 at 6:26 PM jank <j...@familie-karstens.net> wrote:
>
> I am struggling with a single test 'test_huge_int' for the Exasol dialect. 
> The reason the test is not working is specific to that database. I would like 
> to include it from the test suite, but just for that DB. Ideally without 
> changing anything on the central test suite, as the reason that it does not 
> work is not worth cluttering the test suite with a new exclusion.
> Any ideas how this can be achieved?

well the suite tests have many "requirements" decorators for things
that various databases don't provide so we could add a new requirement
decorator for this particular test, if supporting huge integers isn't
going to work on every backend.


> I tried it with the py-test --deselect option, but given that sqlalchemy test 
> case classes are generated at runtime with magic that I do not understand,

SQLAlchemy test cases aren't doing much magic, most of them are
regular methods on regular classes and they are discovered by py.test
in the normal way, however the pytest_pycollect_makeitem hook is used
which appears to render all of their options non-working, so I'd
consider this a bug or limitation in py.test.

A certain subset of tests are copied out using py.test extension APis
to be test-per-database-backend.  However their test selection options
other than "-k" don't work for any of our tests, even the ones that
aren't copied out or anything, just included by
pytest_pycollect_makeitem (which does not have any access to the
filter selections from the pytest command line).   We are only using
documented py.test extensions and if I comment out the weirder one
that is copying the tests, the --deselect option still doesn't work.
Since you're bringing it up I'm trying to see how these work and it's
not obvious, it looks like if you use their hooks then you don't get
most of their select/deselection options.

However you do get the "-k" option, which I think is quite
inconsistent about py.test that they have multiple ways to do the same
thing that all seem to be subtly different, but in any case you can
deselect that test like this:

py.test -k "not (IntegerTest and test_huge_int)"

why I can't say "-k not IntegerTest.test_huge_int" or "--deselect
IntegerTest.test_huge_int", I have no idea,  so I just use -k with
separate phrases for everything.



>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to