File: test_misc_py3k.py

package info (click to toggle)
sqlalchemy 2.0.43%2Bds1-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 26,624 kB
  • sloc: python: 413,648; makefile: 231; sh: 7
file content (17 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import operator
from typing import cast

from sqlalchemy import Column
from sqlalchemy.testing import eq_
from sqlalchemy.testing import fixtures


class TestGenerics(fixtures.TestBase):
    def test_traversible_is_generic(self):
        """test #6759"""
        col = Column[int]

        # looked in the source for typing._GenericAlias.
        # col.__origin__ is Column, but it's not public API.
        # __reduce__ could change too but seems good enough for now
        eq_(cast(object, col).__reduce__(), (operator.getitem, (Column, int)))