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

Fix tests with new pytest #169

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions taskw/test/test_datas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest

from unittest import TestCase
from taskw import TaskWarriorDirect, TaskWarriorShellout


Expand All @@ -16,8 +17,9 @@
'uuid': "c1c431ea-f0dc-4683-9a20-e64fcfa65fd1"}


class _BaseTestDB(object):
def setup(self):
class _BaseTestDB(TestCase):
__test__ = False
def setUp(self):

# Sometimes the 'task' command line tool is not installed.
if self.should_skip():
Expand Down Expand Up @@ -330,6 +332,7 @@ def test_load_tasks_with_one_each(self):


class TestDBDirect(_BaseTestDB):
__test__ = True
class_to_test = TaskWarriorDirect

def test_delete_completed(self):
Expand All @@ -345,6 +348,7 @@ def should_skip(self):


class TestDBShellout(_BaseTestDB):
__test__ = True
class_to_test = TaskWarriorShellout

def should_skip(self):
Expand Down
5 changes: 3 additions & 2 deletions taskw/test/test_recursive.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest

from unittest import TestCase
from taskw import TaskWarriorShellout


Expand All @@ -14,8 +15,8 @@
'uuid': "c1c431ea-f0dc-4683-9a20-e64fcfa65fd1"}


class TestRecursibe(object):
def setup(self):
class TestRecursibe(TestCase):
def setUp(self):
if not TaskWarriorShellout.can_use():
# Sometimes the 'task' command line tool is not installed.
pytest.skip("taskwarrior not installed")
Expand Down
5 changes: 3 additions & 2 deletions taskw/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import dateutil.tz
import pytz

from unittest import TestCase
from taskw.utils import (
convert_dict_to_override_args,
decode_task,
Expand Down Expand Up @@ -31,7 +32,7 @@ def shuffled(l):
return new


class TestUtils(object):
class TestUtils(TestCase):

def test_no_side_effects(self):
orig = TASK.copy()
Expand Down Expand Up @@ -187,7 +188,7 @@ def test_convert_dict_to_override_args(self):
assert set(actual_overrides) == set(expected_overrides)


class TestCleanExecArg(object):
class TestCleanExecArg(TestCase):
def test_clean_null(self):
assert b"" == clean_ctrl_chars(b"\x00")

Expand Down