Exemplo n.º 1
0
class TestCalc:
    # @allure.severity(allure.severity_level.MINOR)
    @pytest.mark.first
    @pytest.mark.parametrize(("a", "b", "c"),
                             yaml.safe_load(open("calc_add.yml")))
    def test_add(self, a, b, c):
        # self.calc = Calc()
        result = Calc().add(a, b)
        print(result)
        assert c == result

    @pytest.mark.parametrize(("a", "b", "c"),
                             yaml.safe_load(open("calc_jian.yml")))
    def test_jian(self, a, b, c):
        self.calc = Calc()
        result = self.calc.jian(a, b)
        print(result)
        assert c == result

    @pytest.mark.run(order=-1)
    @pytest.mark.parametrize(("a", "b", "c"),
                             yaml.safe_load(open("calc_div.yml")))
    def test_div(self, a, b, c):
        self.calc = Calc()
        result = self.calc.div(a, b)
        print(result)
        assert c == result

    @pytest.mark.parametrize(("a", "b", "c"),
                             yaml.safe_load(open("calc_chen.yml")))
    def test_chen(self, a, b, c):
        self.calc = Calc()
        result = self.calc.chen(a, b)
        print(result)
        assert c == result
Exemplo n.º 2
0
class TestCalc:
    @pytest.mark.parametrize(("a", "b", "c"),
                             yaml.safe_load(open("calcTask1/calc_add.yml")))
    def test_add(self, a, b, c):
        self.calc = Calc()
        result = self.calc.add(a, b)
        print(result)
        assert c == result

    def test_div(self):
        self.calc = Calc()
        result = self.calc.div(2, 2)
        print(result)
        assert 1 == result
Exemplo n.º 3
0
 def test_add(self, a, b, c):
     self.calc = Calc()
     result = self.calc.add(a, b)
     print(result)
     assert c == result
Exemplo n.º 4
0
 def test_div(self):
     self.calc = Calc()
     result = self.calc.div(2, 2)
     print(result)
     assert 1 == result
Exemplo n.º 5
0
 def test_chen(self, a, b, c):
     self.calc = Calc()
     result = self.calc.chen(a, b)
     print(result)
     assert c == result
Exemplo n.º 6
0
 def test_div(self, a, b, c):
     self.calc = Calc()
     result = self.calc.div(a, b)
     print(result)
     assert c == result