Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
mkmf.log
learn-test-*.gem
*.swp
__pycache__
.pytest_cache
10 changes: 10 additions & 0 deletions spec/features/pytest_unit_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe "Running a Pytest Unit Test" do
context "a basic pytest unit test" do
it "runs the spec with 0 failures" do
output = `cd ./spec/fixtures/pytest-unit-spec && ./../../../bin/learn-test --local --test`

expect(output).to include("2 passed")
expect(output).to_not include("1 failed")
end
end
end
5 changes: 5 additions & 0 deletions spec/fixtures/pytest-unit-spec/dog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Dog(object):

def __init__(self, name, breed):
self.name = name
self.breed = breed
12 changes: 12 additions & 0 deletions spec/fixtures/pytest-unit-spec/pytests/test_dog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest
from dog import *

@pytest.fixture
def dog():
return(Dog("Fido", "Good Boy"))

def test_dog_name(dog):
assert dog.name == "Fido"

def test_dog_breed(dog):
assert dog.breed == "Good Boy"