Skip to content

Commit

Permalink
test: Fail on unhandled warnings (#2197)
Browse files Browse the repository at this point in the history
* test: Fail on unhandled warnings

* Address SQLAlchemy deprecation

* Fix a bunch of gitlab types

* More type fixes

* Fix GA types
  • Loading branch information
edgarrmondragon authored Jan 30, 2024
1 parent 9bb7066 commit af3b678
Show file tree
Hide file tree
Showing 7 changed files with 456 additions and 319 deletions.
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,26 @@ pytest-codspeed = ">=2.2.0"

[tool.pytest.ini_options]
addopts = '--ignore=singer_sdk/helpers/_simpleeval.py -m "not external"'
filterwarnings = [
"error",
"ignore:Could not configure external gitlab tests:UserWarning",
"ignore:No records were available to test:UserWarning",
# https://github.com/meltano/sdk/issues/1354
"ignore:The function singer_sdk.testing.get_standard_tap_tests is deprecated:DeprecationWarning",
# https://docs.python.org/3.12/whatsnew/3.12.html#deprecated
# https://github.com/danthedeckie/simpleeval/blob/master/simpleeval.py
"ignore:ast.NameConstant is deprecated:DeprecationWarning:simpleeval",
# https://docs.python.org/3.12/whatsnew/3.12.html#deprecated
# https://github.com/danthedeckie/simpleeval/blob/master/simpleeval.py
"ignore:ast.Num is deprecated:DeprecationWarning:simpleeval",
# https://github.com/joblib/joblib/pull/1518
"ignore:ast.Num is deprecated:DeprecationWarning:joblib._utils",
# https://docs.python.org/3.12/whatsnew/3.12.html#deprecated
# https://github.com/danthedeckie/simpleeval/blob/master/simpleeval.py
"ignore:ast.Str is deprecated:DeprecationWarning:simpleeval",
# https://github.com/joblib/joblib/pull/1518
"ignore:Attribute n is deprecated:DeprecationWarning:joblib._utils",
]
markers = [
"external: Tests relying on external resources",
"windows: Tests that only run on Windows",
Expand Down
13 changes: 12 additions & 1 deletion samples/sample_tap_gitlab/gitlab_rest_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
DateTimeType,
DateType,
IntegerType,
ObjectType,
PropertiesList,
Property,
StringType,
Expand Down Expand Up @@ -158,7 +159,6 @@ class EpicsStream(ProjectBasedStream):
Property("title", StringType),
Property("description", StringType),
Property("state", StringType),
Property("author_id", IntegerType),
Property("start_date", DateType),
Property("end_date", DateType),
Property("due_date", DateType),
Expand All @@ -167,6 +167,17 @@ class EpicsStream(ProjectBasedStream):
Property("labels", ArrayType(StringType)),
Property("upvotes", IntegerType),
Property("downvotes", IntegerType),
Property(
"author",
ObjectType(
Property("id", IntegerType),
Property("name", StringType),
Property("username", StringType),
Property("state", StringType),
Property("avatar_url", StringType),
Property("web_url", StringType),
),
),
).to_dict()

def get_child_context(
Expand Down
Loading

0 comments on commit af3b678

Please sign in to comment.