Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import directly from wxflow in tests #9

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ where=src

[options.extras_require]
dev = pytest>=7; pytest-cov>=3; isort>=5; pycodestyle>=2; pre-commit>=2; tox>=3
docs = sphinx>=4; sphinx-autobuild; sphinx_td_theme>=0.5; furo>=2023.03.23; sphinx-copybutton
docs = sphinx>=4; sphinx-autobuild; sphinx_rtd_theme>=0.5; furo>=2023.03.23; sphinx-copybutton

[green]
file-pattern = test_*.py
Expand Down
2 changes: 1 addition & 1 deletion tests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from wxflow.configuration import Configuration, cast_as_dtype
from wxflow import Configuration, cast_as_dtype

file0 = """#!/bin/bash
export SOME_ENVVAR1="${USER}"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from wxflow.exceptions import WorkflowException
from wxflow import WorkflowException

# ----

Expand Down
2 changes: 1 addition & 1 deletion tests/test_executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from wxflow.executable import CommandNotFoundError, Executable, which
from wxflow import CommandNotFoundError, Executable, which

script = """#!/bin/bash
echo ${USER}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from wxflow.factory import Factory
from wxflow import Factory


class Class1:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_file_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from wxflow.file_utils import FileHandler
from wxflow import FileHandler


def test_mkdir(tmp_path):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import pytest

from wxflow.jinja import Jinja
from wxflow.timetools import to_isotime
from wxflow import Jinja, to_isotime

current_date = datetime.now()
j2tmpl = """Hello {{ name }}! {{ greeting }} It is: {{ current_date | to_isotime }}"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from wxflow.logger import Logger, logit
from wxflow import Logger, logit

level = 'debug'
number_of_log_msgs = 5
Expand Down
7 changes: 2 additions & 5 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@

import pytest

from wxflow import schema
from wxflow.configuration import cast_strdict_as_dtypedict
from wxflow.schema import SchemaError
from wxflow.yaml_file import parse_yaml
from wxflow import schema, parse_yaml, cast_strdict_as_dtypedict


# Define the path to the YAML-formatted file containing the schema
Expand Down Expand Up @@ -71,7 +68,7 @@ def test_validate_schema():
try:
data_out = schema.validate_schema(
schema_dict=schema_dict, data=data_in)
except SchemaError:
except schema.SchemaError:
assert True

# This unit-test passes the full environment, including `data_in`,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from wxflow.template import Template, TemplateConstants
from wxflow import Template, TemplateConstants


def test_substitute_string_from_dict():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_timetools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime, timedelta

from wxflow.timetools import *
from wxflow import *

current_date = datetime.now()

Expand Down
4 changes: 2 additions & 2 deletions tests/test_yaml_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import pytest

from wxflow.yaml_file import (YAMLFile, dump_as_yaml, parse_j2yaml,
parse_yamltmpl, save_as_yaml)
from wxflow import (YAMLFile, dump_as_yaml, parse_j2yaml,
parse_yamltmpl, save_as_yaml)

host_yaml = """
host:
Expand Down
Loading