Skip to content
Permalink
Browse files

Merge two tests into single parameterised tests

  • Loading branch information
darrenburns committed Jan 20, 2020
1 parent 7f43adc commit f85777bfaf83834381450a9ed686d777a5d05bab
Showing with 8 additions and 11 deletions.
  1. +8 −11 tests/test_collect.py
@@ -3,7 +3,7 @@

from ward import test, fixture, expect, raises
from ward.collect import search_generally, is_test_module
from ward.testing import Test
from ward.testing import Test, each


def named():
@@ -45,13 +45,10 @@ def _(tests=tests_to_search):
next(results)


@test("is_test_module returns True when module name begins with 'test_'")
def _():
module = ModuleInfo(ModuleFinder(), "test_apples", False)
expect(is_test_module(module)).equals(True)


@test("is_test_module returns False when module name doesn't begin with 'test_'")
def _():
module = ModuleInfo(ModuleFinder(), "apples_test", False)
expect(is_test_module(module)).equals(False)
@test("is_test_module(<module: '{module_name}'>) returns {rv}")
def _(
module_name=each("test_apples", "apples"),
rv=each(True, False),
):
module = ModuleInfo(ModuleFinder(), module_name, False)
expect(is_test_module(module)).equals(rv)

0 comments on commit f85777b

Please sign in to comment.
You can’t perform that action at this time.