summaryrefslogtreecommitdiff
path: root/test/orm/inheritance/test_abc_inheritance.py
Commit message (Collapse)AuthorAgeFilesLines
* Modernize tests - calling_mapper_directlyGord Thompson2021-09-301-4/+3
| | | | | | | | | | | | | a few changes for py2k: * map_imperatively() includes the check that a class is being sent, this was only working for mapper() before * the test suite didn't place the py2k "autouse" workaround in the correct order, seemingly, tried to adjust the per-test ordering setup in pytestplugin.py Change-Id: I4cc39630724e810953cfda7b2afdadc8b948e3c2
* remove more bound metadataMike Bayer2021-01-051-2/+2
| | | | | | | | | | | | | | in Iae6ab95938a7e92b6d42086aec534af27b5577d3 I missed that the "bind" was being stuck onto the MetaData in TablesTest, which led thousands of ORM tests to still use bound metadata. Keep looking for bound metadata. standardize all ORM tests on a single means of getting a Session when the Session API isn't the thing we are directly testing, using a new function fixture_session() that replaces create_session() and uses modern defaults. Change-Id: Iaf71206e9ee568151496d8bc213a069504bf65ef
* upgrade to black 20.8b1Mike Bayer2020-09-281-1/+4
| | | | | | | It's better, the majority of these changes look more readable to me. also found some docstrings that had formatting / quoting issues. Change-Id: I582a45fde3a5648b2f36bab96bad56881321899b
* Create a framework to allow all SQLALCHEMY_WARN_20 to passMike Bayer2020-09-161-269/+236
| | | | | | | | | | | | | | | | | | | | | As the test suite has widespread use of many patterns that are deprecated, enable SQLALCHEMY_WARN_20 globally for the test suite but then break the warnings filter out into a whole list of all the individual warnings we are looking for. this way individual changesets can target a specific class of warning, as many of these warnings will indivdidually affect dozens of files and potentially hundreds of lines of code. Many warnings are also resolved here as this patch started out that way. From this point forward there should be changesets that target a subset of the warnings at a time. For expediency, updates some migration 2.0 docs for ORM as well. Change-Id: I98b8defdf7c37b818b3824d02f7668e3f5f31c94
* Query linter optionAlessio Bogon2020-01-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added "from linting" as a built-in feature to the SQL compiler. This allows the compiler to maintain graph of all the FROM clauses in a particular SELECT statement, linked by criteria in either the WHERE or in JOIN clauses that link these FROM clauses together. If any two FROM clauses have no path between them, a warning is emitted that the query may be producing a cartesian product. As the Core expression language as well as the ORM are built on an "implicit FROMs" model where a particular FROM clause is automatically added if any part of the query refers to it, it is easy for this to happen inadvertently and it is hoped that the new feature helps with this issue. The original recipe is from: https://github.com/sqlalchemy/sqlalchemy/wiki/FromLinter The linter is now enabled for all tests in the test suite as well. This has necessitated that a lot of the queries be adjusted to not include cartesian products. Part of the rationale for the linter to not be enabled for statement compilation only was to reduce the need for adjustment for the many test case statements throughout the test suite that are not real-world statements. This gerrit is adapted from Ib5946e57c9dba6da428c4d1dee6760b3e978dda0. Fixes: #4737 Change-Id: Ic91fd9774379f895d021c3ad564db6062299211c Closes: #4830 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4830 Pull-request-sha: f8a21aa6262d1bcc9ff0d11a2616e41fba97a47a
* Use roles for ORM alias() conversionMike Bayer2019-05-271-3/+5
| | | | | | | | as SELECT statements will have subquery() and not alias(), start getting ready for the places where the ORM coerces SELECTs into subqueries and be ready to warn about it Change-Id: I90d4b6cae2c72816c6b192016ce074589caf4731
* Post black reformattingMike Bayer2019-01-061-6/+12
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-061-55/+141
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* Make all tests to be PEP8 compliantKhairi Hafsham2017-02-071-46/+73
| | | | | | | | tested using pycodestyle version 2.2.0 Fixes: #3885 Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
* - a variety of test adjustments to accomodate for MySQL 5.7Mike Bayer2016-07-241-1/+2
| | | | Change-Id: Ied4245433d0d7b469dae6e7394c4931d8405f387
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-3/+3
| | | | | | | become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries.
* - [feature] Added reduce_columns() methodMike Bayer2012-07-281-3/+2
| | | | | | | | | | | | | | | to select() construct, replaces columns inline using the util.reduce_columns utility function to remove equivalent columns. reduce_columns() also adds "with_only_synonyms" to limit the reduction just to those columns which have the same name. The deprecated fold_equivalents() feature is removed [ticket:1729]. - [feature] Added with_labels and reduce_columns keyword arguments to Query.subquery(), to provide two alternate strategies for producing queries with uniquely- named columns. [ticket:1729].
* -whitespace bonanza, contdMike Bayer2012-07-281-4/+4
|
* many fixes but still can't get heuristics to work as well as what's existing,Mike Bayer2012-02-111-1/+5
| | | | tests still failing
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-2/+2
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* - whitespace removal bonanzaMike Bayer2011-01-021-2/+2
|
* - move sqlalchemy.test to test.libMike Bayer2010-11-151-2/+2
|
* - The official name for the relation() function is nowMike Bayer2010-03-171-3/+3
| | | | | | relationship(), to eliminate confusion over the relational algebra term. relation() however will remain available in equal capacity for the foreseeable future. [ticket:1740]
* deprecations per [ticket:1498]:Mike Bayer2009-10-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - deprecated PassiveDefault - use DefaultClause. - the BINARY and MSBinary types now generate "BINARY" in all cases. Omitting the "length" parameter will generate "BINARY" with no length. Use BLOB to generate an unlengthed binary column. - the "quoting='quoted'" argument to MSEnum/ENUM is deprecated. It's best to rely upon the automatic quoting. - "shortname" attribute on bindparam() is removed. - fold_equivalents flag on join is deprecated (will remain until [ticket:1131] is implemented) - "scalar" flag on select() is removed, use select.as_scalar(). - 'transactional' flag on sessionmaker() and others is removed. Use 'autocommit=True' to indicate 'transactional=False'. - 'polymorphic_fetch' argument on mapper() is removed. Loading can be controlled using the 'with_polymorphic' option. - 'select_table' argument on mapper() is removed. Use 'with_polymorphic=("*", <some selectable>)' for this functionality. - 'proxy' argument on synonym() is removed. This flag did nothing throughout 0.5, as the "proxy generation" behavior is now automatic. - Passing a single list of elements to eagerload(), eagerload_all(), contains_eager(), lazyload(), defer(), and undefer() instead of multiple positional -args is deprecated. - Passing a single list of elements to query.order_by(), query.group_by(), query.join(), or query.outerjoin() instead of multiple positional *args is deprecated. - query.iterate_instances() is removed. Use query.instances(). - Query.query_from_parent() is removed. Use the sqlalchemy.orm.with_parent() function to produce a "parent" clause, or alternatively query.with_parent(). - query._from_self() is removed, use query.from_self() instead. - the "comparator" argument to composite() is removed. Use "comparator_factory". - RelationProperty._get_join() is removed. - the 'echo_uow' flag on Session is removed. Use logging on the "sqlalchemy.orm.unitofwork" name. - session.clear() is removed. use session.expunge_all(). - session.save(), session.update(), session.save_or_update() are removed. Use session.add() and session.add_all(). - the "objects" flag on session.flush() remains deprecated. - the "dont_load=True" flag on session.merge() is deprecated in favor of "load=False". - passing an InstanceState (internal SQLAlchemy state object) to attributes.init_collection() or attributes.get_history() is deprecated. These functions are public API and normally expect a regular mapped object instance. - the 'engine' parameter to declarative_base() is removed. Use the 'bind' keyword argument.
* merge 0.6 series to trunk.Mike Bayer2009-08-061-1/+2
|
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-0/+170
See README.unittests for information on how to run the tests. [ticket:970]