Skip to content

Commit

Permalink
refactor: fix formatting on test code
Browse files Browse the repository at this point in the history
  • Loading branch information
0hsn committed Dec 27, 2024
1 parent 71f4ae8 commit 38b3ed2
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 13 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poe.tasks]
test = "py.test -s"
clear-cache = "rm -rf .chkware_cache"
requirements-root = 'poetry export --output requirements.txt'
requirements-test = 'poetry export --output requirements-dev.txt --with test'
Expand Down
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
common config
"""

import pytest

from chk.infrastructure.file_loader import ExecuteContext, FileContext, FileLoader
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" ConfTest """
"""ConfTest"""

import pytest
from loguru import logger
Expand Down
1 change: 1 addition & 0 deletions tests/console/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Test module for main
"""

import click
import pytest

Expand Down
2 changes: 1 addition & 1 deletion tests/infrastructure/document_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Document test
"""

import pytest

from chk.infrastructure.document import VersionedDocument, VersionedDocumentSupport
Expand All @@ -11,7 +12,6 @@


class TestVersionedDocumentSupport:

@staticmethod
def test_validate_with_schema_pass():
document = {
Expand Down
1 change: 1 addition & 0 deletions tests/infrastructure/file_loader_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# type: ignore

"""test loader"""

import sys
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions tests/infrastructure/helper_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
test global chk functions
"""

import math
import sys
from io import TextIOWrapper, BytesIO
Expand Down
7 changes: 4 additions & 3 deletions tests/infrastructure/symbol_table_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Tests for symbol table
"""

import json

from chk.console.main import combine_initial_variables
Expand Down Expand Up @@ -319,10 +320,10 @@ def test_get_exposed_replaced_data_pass_returns_nonempty_list():


class TestExecResponse:

@staticmethod
def test_pass():
er = ExecResponse(file_ctx={}, exec_ctx={}, variables=Variables(),
variables_exec=Variables())
er = ExecResponse(
file_ctx={}, exec_ctx={}, variables=Variables(), variables_exec=Variables()
)

assert id(er.exposed) != id(er.report)
2 changes: 0 additions & 2 deletions tests/infrastructure/templating_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class TestJinjaTemplate:

@staticmethod
def test_basic_tpl_create():
data = {
Expand All @@ -30,6 +29,5 @@ def test_basic_tpl_create():

@staticmethod
def test_basic_tpl_create_fail():

with pytest.raises(ValueError):
JinjaTemplate.make("")
1 change: 0 additions & 1 deletion tests/modules/fetch/fetch_module_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ def test_fails_for_http_error():

assert isinstance(er, ExecResponse)
assert isinstance(er.exception, requests.ConnectionError)

1 change: 1 addition & 0 deletions tests/modules/validate/assertion_function_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
Test module for assertion Functions mod
"""

import pytest

import chk.modules.validate.assertion_function as asrt
Expand Down
1 change: 1 addition & 0 deletions tests/modules/validate/assertion_message_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
Test module for assertion Functions support func
"""

import chk.modules.validate.assertion_message as asrt


Expand Down
1 change: 1 addition & 0 deletions tests/modules/validate/assertion_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Test assertion_services
"""

import copy
import types

Expand Down
1 change: 1 addition & 0 deletions tests/modules/validate/validate_entity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Validation entity test
"""

import pytest

from chk.infrastructure.file_loader import FileContext, ExecuteContext
Expand Down
7 changes: 4 additions & 3 deletions tests/modules/workflow/wf_domain_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Domain test code
"""

from pydantic import BaseModel, Field

from chk.infrastructure.symbol_table import Variables
Expand All @@ -13,7 +14,6 @@
class TestWorkflowDocument:
@staticmethod
def test_from_file_context_pass(load_chk_file, load_file_ctx_for_file):

class TaskDict(BaseModel):
file: str = Field(default=str)
name: str = Field(default=str)
Expand All @@ -30,7 +30,6 @@ class TaskDict(BaseModel):

@staticmethod
def test_from_file_context_pass_noid(load_chk_file, load_file_ctx_for_file):

class TaskDict(BaseModel):
file: str = Field(default=str)
name: str = Field(default=str)
Expand Down Expand Up @@ -58,5 +57,7 @@ def test_process_task_template_pass(load_chk_file, load_file_ctx_for_file):

wfdoc = WorkflowDocument.from_file_context(file_ctx)

rpt = WorkflowDocumentSupport.process_task_template(wfdoc, Variables({"_steps": []}))
rpt = WorkflowDocumentSupport.process_task_template(
wfdoc, Variables({"_steps": []})
)
assert isinstance(rpt, list)
2 changes: 1 addition & 1 deletion tests/modules/workflow/wf_entities_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Testing Entities for workflow
"""

from pathlib import Path

import pytest
Expand All @@ -25,7 +26,6 @@
class TestChkwareTask:
@staticmethod
def test_from_dict_pass():

task = ChkwareTask(
fp,
**{
Expand Down

0 comments on commit 38b3ed2

Please sign in to comment.