Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UnitTestsDemo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PythonDataScienceMatSci
UnitTestsDemo
Merge requests
!1
Corrections trk
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Corrections trk
corrections-trk
into
main
Overview
0
Commits
2
Pipelines
0
Changes
2
Merged
Corrections trk
Tom Reclik
requested to merge
corrections-trk
into
main
Mar 27, 2023
Overview
0
Commits
2
Pipelines
0
Changes
2
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
b594c460
2 commits,
Mar 27, 2023
2 files
+
12
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
tests/test_fibonaccy.py
+
6
−
3
View file @ b594c460
Edit in single-file editor
Open in Web IDE
from
unittestdemo
import
fibonacci
as
fib
import
pytest
def
test_fibonacci_sequence
():
numbers
=
fib
.
compute_Fibonacci
(
n_numbers
=
10
)
assert
numbers
==
[
0
,
1
,
1
,
2
,
3
,
5
,
8
,
13
,
21
,
34
]
def
test_raise_TypeError
():
with
pytest
.
raises
(
TypeError
):
numbers
=
fib
.
compute_Fibonacci
(
n_numbers
=
'
10
'
)
numbers
=
fib
.
compute_Fibonacci
(
n_numbers
=
"
10
"
)
# add a test for integers n_numbers < 2
#
# ... your code here ...
# Hint:
# - modify compute_Fibonacci to catch these cases
# - modify compute_Fibonacci to catch these cases
# - add a corresponding test
#
\ No newline at end of file
#
Loading