]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Improve testcase condition statement for dialects
authorj00356287 <jiajunsu@huawei.com>
Thu, 5 Sep 2019 15:50:13 +0000 (11:50 -0400)
committersqla-tester <sqla-tester@sqlalchemy.org>
Thu, 5 Sep 2019 15:50:13 +0000 (11:50 -0400)
We could get dialect.requires_name_normalize rather than use hard code
as "firebird" or "oracle", since we have add `normalize` attribute for
quite a long time.

### Description

Use `dialect.requires_name_normalize` instead `testing.against("firebird", "oracle")`

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #4843
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4843
Pull-request-sha: 304fe67b06c1f010a164806a12b68cfce9bd0d2b

Change-Id: I276f781482779473258f9269074847e283711b05

test/engine/test_reflection.py

index 2451822b1c437c417f0aafa6a5f5a27347fae59a..2bff3fa627bc5f74f637083d65558d8cb0dba3cd 100644 (file)
@@ -1146,10 +1146,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
         )
         sa.Index("where", table_a.c["from"])
 
-        # There's currently no way to calculate identifier case
-        # normalization in isolation, so...
-
-        if testing.against("firebird", "oracle"):
+        if meta.bind.dialect.requires_name_normalize:
             check_col = "TRUE"
         else:
             check_col = "true"