Skip to content

Commit e2c69df

Browse files
Update more classes to use ClassVar[bool] for __test__ attributes
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 40fddcc commit e2c69df

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

unit_tests/sources/declarative/decoders/test_composite_decoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from http.server import BaseHTTPRequestHandler, HTTPServer
99
from io import BytesIO, StringIO
1010
from threading import Thread
11-
from typing import Iterable
11+
from typing import ClassVar, Iterable
1212
from unittest.mock import Mock, patch
1313

1414
import pytest
@@ -259,7 +259,7 @@ def test_composite_raw_decoder_csv_parser_values(requests_mock, encoding: str, d
259259

260260

261261
class TestServer(BaseHTTPRequestHandler):
262-
__test__ = False # Prevent pytest from thinking that this is a test class, despite the name
262+
__test__: ClassVar[bool] = False # Prevent pytest from thinking that this is a test class, despite the name
263263

264264
def do_GET(self) -> None:
265265
self.send_response(200)

unit_tests/sources/declarative/test_yaml_declarative_source.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import logging
66
import os
77
import tempfile
8+
from typing import ClassVar
89

910
import pytest
1011
from yaml.parser import ParserError
@@ -133,7 +134,7 @@ def test_source_with_missing_reference_fails(self):
133134

134135

135136
class TestFileContent:
136-
__test__ = False # Prevent pytest from thinking that this is a test class, despite the name
137+
__test__: ClassVar[bool] = False # Prevent pytest from thinking that this is a test class, despite the name
137138

138139
def __init__(self, content):
139140
self.file = tempfile.NamedTemporaryFile(mode="w", delete=False)

unit_tests/sources/file_based/scenarios/scenario_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from abc import ABC, abstractmethod
55
from copy import deepcopy
66
from dataclasses import dataclass, field
7-
from typing import Any, Generic, List, Mapping, Optional, Set, Tuple, Type, TypeVar
7+
from typing import Any, ClassVar, Generic, List, Mapping, Optional, Set, Tuple, Type, TypeVar
88

99
from airbyte_cdk.models import (
1010
AirbyteAnalyticsTraceMessage,
@@ -42,7 +42,7 @@ def build(
4242

4343

4444
class TestScenario(Generic[SourceType]):
45-
__test__ = False # Prevent pytest from thinking that this is a test class, despite the name
45+
__test__: ClassVar[bool] = False # Prevent pytest from thinking that this is a test class, despite the name
4646

4747
def __init__(
4848
self,

unit_tests/sources/file_based/test_file_based_stream_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import logging
66
from datetime import datetime
77
from io import IOBase
8-
from typing import Any, Dict, Iterable, List, Mapping, Optional, Set
8+
from typing import Any, ClassVar, Dict, Iterable, List, Mapping, Optional, Set
99

1010
import pytest
1111
from pydantic.v1 import AnyUrl
@@ -62,7 +62,7 @@
6262

6363

6464
class TestStreamReader(AbstractFileBasedStreamReader):
65-
__test__ = False # Prevent pytest from thinking that this is a test class, despite the name
65+
__test__: ClassVar[bool] = False # Prevent pytest from thinking that this is a test class, despite the name
6666

6767
@property
6868
def config(self) -> Optional[AbstractFileBasedSpec]:
@@ -102,7 +102,7 @@ def identities_schema(self) -> Dict[str, Any]:
102102

103103

104104
class TestSpec(AbstractFileBasedSpec):
105-
__test__ = False # Prevent pytest from thinking that this is a test class, despite the name
105+
__test__: ClassVar[bool] = False # Prevent pytest from thinking that this is a test class, despite the name
106106

107107
@classmethod
108108
def documentation_url(cls) -> AnyUrl:

0 commit comments

Comments
 (0)