Skip to content

Instantly share code, notes, and snippets.

@progapandist
Created January 19, 2021 15:10
Show Gist options
  • Save progapandist/7db084471c6936be33f2d4037723f4e7 to your computer and use it in GitHub Desktop.
Save progapandist/7db084471c6936be33f2d4037723f4e7 to your computer and use it in GitHub Desktop.
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/00-Setup/02-Git
collecting ... collected 2 items
tests/test_git.py::TestGit::test_hi_my_name_is PASSED [ 50%]
tests/test_git.py::TestGit::test_my_buddy_is PASSED [100%]
============================== 2 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/00-Setup/01-Check
collecting ... collected 3 items
tests/test_demo.py::TestDemo::test_returns_3_14_for_radius_1 PASSED [ 33%]
tests/test_demo.py::TestDemo::test_returns_78_5_for_radius_5 PASSED [ 66%]
tests/test_demo.py::TestDemo::test_returns_zero_for_negative_radius PASSED [100%]
============================== 3 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/02-Data-Sourcing/03-Text-Extraction-with-Regex
collecting ... collected 10 items
tests/test_patterns.py::TestPatterns::test_amount_group_pattern PASSED [ 10%]
tests/test_patterns.py::TestPatterns::test_amount_pattern PASSED [ 20%]
tests/test_patterns.py::TestPatterns::test_date_pattern PASSED [ 30%]
tests/test_patterns.py::TestPatterns::test_quantity_group_pattern PASSED [ 40%]
tests/test_patterns.py::TestPatterns::test_quantity_pattern PASSED [ 50%]
tests/test_patterns.py::TestPatterns::test_zip_code_pattern PASSED [ 60%]
tests/test_receipts.py::TestReceipts::test_receipt PASSED [ 70%]
tests/test_receipts.py::TestReceipts::test_receipts_df_size PASSED [ 80%]
tests/test_receipts.py::TestReceipts::test_receipts_dict PASSED [ 90%]
tests/test_receipts.py::TestReceipts::test_receipts_list PASSED [100%]
============================== 10 passed in 0.42s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/02-Data-Sourcing/00-Warmup
collecting ... collected 4 items
tests/test_opengraph.py::TestOpenGraph::test_a_com PASSED [ 25%]
tests/test_opengraph.py::TestOpenGraph::test_empty_url PASSED [ 50%]
tests/test_opengraph.py::TestOpenGraph::test_lewagon_com PASSED [ 75%]
tests/test_warmup.py::TestWarmup::test_dataframe_has_new_columns PASSED [100%]
============================== 4 passed in 1.52s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/02-Data-Sourcing/01-Stock-Market-API
collecting ... collected 3 items
tests/test_apple.py::TestApple::test_apple_df_columns FAILED [ 33%]
tests/test_apple.py::TestApple::test_apple_df_index_is_timestamp PASSED [ 66%]
tests/test_apple.py::TestApple::test_apple_df_index_name_is_date PASSED [100%]
=================================== FAILURES ===================================
_______________________ TestApple.test_apple_df_columns ________________________
self = <tests.test_apple.TestApple testMethod=test_apple_df_columns>
def test_apple_df_columns(self):
> self.assertEqual(
list(self.result.columns),
sorted([
'close', 'high', 'low', 'open', 'symbol', 'volume', 'id',
'key', 'subkey', 'updated', 'changeOverTime',
'marketChangeOverTime', 'uOpen', 'uClose', 'uHigh', 'uLow',
'uVolume', 'fOpen', 'fClose', 'fHigh', 'fLow', 'fVolume',
'label', 'change', 'changePercent'
])
)
E AssertionError: Lists differ: ['close', 'high', 'low', 'open', 'symbol', '[225 chars]ode'] != ['change', 'changeOverTime', 'changePercent'[209 chars]ume']
E 
E First differing element 0:
E 'close'
E 'change'
E 
E First list contains 1 additional elements.
E First extra element 25:
E 'company_code'
E 
E + ['change',
E + 'changeOverTime',
E + 'changePercent',
E - ['close',
E ? ^
E 
E + 'close',
E ? ^
E 
E + 'fClose',
E + 'fHigh',
E + 'fLow',
E + 'fOpen',
E + 'fVolume',
E 'high',
E - 'low',
E - 'open',
E - 'symbol',
E - 'volume',
E 'id',
E 'key',
E + 'label',
E + 'low',
E + 'marketChangeOverTime',
E + 'open',
E 'subkey',
E + 'symbol',
E - 'updated',
E - 'changeOverTime',
E - 'marketChangeOverTime',
E - 'uOpen',
E 'uClose',
E 'uHigh',
E 'uLow',
E + 'uOpen',
E 'uVolume',
E + 'updated',
E - 'fOpen',
E - 'fClose',
E - 'fHigh',
E - 'fLow',
E - 'fVolume',
E ? ^^ ^
E 
E + 'volume']
E ? ^ ^
E 
E - 'label',
E - 'change',
E - 'changePercent',
E - 'company_code']
tests/test_apple.py:13: AssertionError
=========================== short test summary info ============================
FAILED tests/test_apple.py::TestApple::test_apple_df_columns - AssertionError...
========================= 1 failed, 2 passed in 0.45s ==========================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/02-Data-Sourcing/02-Scraping
collecting ... collected 6 items
tests/test_books.py::TestBooks::test_books_df_columns_name PASSED [ 16%]
tests/test_books.py::TestBooks::test_books_df_columns_size PASSED [ 33%]
tests/test_books.py::TestBooks::test_books_dict_id_defined PASSED [ 50%]
tests/test_books.py::TestBooks::test_first_book_price PASSED [ 66%]
tests/test_books.py::TestBooks::test_first_book_rating PASSED [ 83%]
tests/test_books.py::TestBooks::test_first_book_title PASSED [100%]
============================== 6 passed in 0.35s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module quiz
quiz.py:10:4: W0612: Unused variable 'possible_answers' (unused-variable)
quiz.py:24:4: W0612: Unused variable 'possible_answers' (unused-variable)
quiz.py:38:4: W0612: Unused variable 'possible_answers' (unused-variable)
quiz.py:52:4: W0612: Unused variable 'possible_answers' (unused-variable)
quiz.py:68:4: W0612: Unused variable 'possible_answers' (unused-variable)
quiz.py:82:4: W0612: Unused variable 'possible_answers' (unused-variable)
quiz.py:98:4: W0612: Unused variable 'possible_answers' (unused-variable)
------------------------------------------------------------------
Your code has been rated at 7.50/10 (previous run: 7.50/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/03-Data-Visualization/05-Caveats-Quiz
collecting ... collected 7 items
tests/test_caveat.py::TestCaveatQuiz::test_question_bar_plot PASSED [ 14%]
tests/test_caveat.py::TestCaveatQuiz::test_question_bar_plot_columns PASSED [ 28%]
tests/test_caveat.py::TestCaveatQuiz::test_question_color_blind_palette PASSED [ 42%]
tests/test_caveat.py::TestCaveatQuiz::test_question_color_palette PASSED [ 57%]
tests/test_caveat.py::TestCaveatQuiz::test_question_color_uses PASSED [ 71%]
tests/test_caveat.py::TestCaveatQuiz::test_question_diverging_color_palette PASSED [ 85%]
tests/test_caveat.py::TestCaveatQuiz::test_question_line_plot PASSED [100%]
============================== 7 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/01-Data-Analysis/03-Multiple-Files-With-Pandas
collecting ... collected 3 items
tests/test_olympic_games.py::TestOlympicGames::test_all_countries_df_shape PASSED [ 33%]
tests/test_olympic_games.py::TestOlympicGames::test_summer_countries_df_shape PASSED [ 66%]
tests/test_olympic_games.py::TestOlympicGames::test_top_10_countries_medals PASSED [100%]
============================== 3 passed in 0.13s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/01-Data-Analysis/01-Numpy
collecting ... collected 5 items
tests/test_numpy.py::TestNumpy::test_advanced_matrixes_manipulation PASSED [ 20%]
tests/test_numpy.py::TestNumpy::test_linear_twenty_vector_creation PASSED [ 40%]
tests/test_numpy.py::TestNumpy::test_matrixes_creation_and_reshaping PASSED [ 60%]
tests/test_numpy.py::TestNumpy::test_ndarrays_creation PASSED [ 80%]
tests/test_numpy.py::TestNumpy::test_vectors_creation PASSED [100%]
============================== 5 passed in 0.14s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/01-Data-Analysis/01-Notebook
collecting ... collected 3 items
tests/test_hello.py::TestHelloWorld::test_says_hello PASSED [ 33%]
tests/test_import_hello.py::TestImportHello::test_method_returns_a_string PASSED [ 66%]
tests/test_import_hello.py::TestImportHello::test_method_returns_correct_sentence PASSED [100%]
============================== 3 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/01-Data-Analysis/02-US-Oil-and-Gas-Production
collecting ... collected 4 items
tests/test_gas.py::TestGas::test_month_column_is_a_datetime PASSED [ 25%]
tests/test_gas.py::TestGas::test_yearly_gas_production_df_has_the_right_shape PASSED [ 50%]
tests/test_merged_dataframes.py::TestMergedDataframes::test_merged_df_has_the_right_shape PASSED [ 75%]
tests/test_merged_dataframes.py::TestMergedDataframes::test_yearly_oil_value_2008 PASSED [100%]
============================== 4 passed in 0.13s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module seller_solution
seller_solution.py:21:0: C0301: Line too long (120/100) (line-too-long)
seller_solution.py:39:0: C0301: Line too long (106/100) (line-too-long)
seller_solution.py:40:0: C0301: Line too long (108/100) (line-too-long)
seller_solution.py:55:0: C0301: Line too long (102/100) (line-too-long)
seller_solution.py:1:0: C0114: Missing module docstring (missing-module-docstring)
seller_solution.py:3:0: E0401: Unable to import 'olist.data' (import-error)
seller_solution.py:4:0: E0401: Unable to import 'olist.order' (import-error)
seller_solution.py:7:0: C0115: Missing class docstring (missing-class-docstring)
seller_solution.py:44:8: C0103: Argument name "d" doesn't conform to snake_case naming style (invalid-name)
seller_solution.py:48:12: R1705: Unnecessary "else" after "return" (no-else-return)
seller_solution.py:53:8: C0103: Argument name "d" doesn't conform to snake_case naming style (invalid-name)
seller_solution.py:69:8: C0103: Variable name "df" doesn't conform to snake_case naming style (invalid-name)
seller_solution.py:102:8: C0103: Variable name "df" doesn't conform to snake_case naming style (invalid-name)
seller_solution.py:103:8: C0103: Variable name "df" doesn't conform to snake_case naming style (invalid-name)
------------------------------------------------------------------
Your code has been rated at 6.56/10 (previous run: 6.56/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers
collecting ... collected 8 items
tests/test_seller.py::TestSeller::test_average_delay_carrier FAILED [ 12%]
tests/test_seller.py::TestSeller::test_average_review_score FAILED [ 25%]
tests/test_seller.py::TestSeller::test_average_sales FAILED [ 37%]
tests/test_seller.py::TestSeller::test_columns FAILED [ 50%]
tests/test_seller.py::TestSeller::test_quantity FAILED [ 62%]
tests/test_seller.py::TestSeller::test_shape FAILED [ 75%]
tests/test_seller.py::TestSeller::test_unique_state FAILED [ 87%]
tests/test_seller.py::TestSeller::test_wait_time FAILED [100%]
=================================== FAILURES ===================================
____________________ TestSeller.test_average_delay_carrier _____________________
self = <tests.test_seller.TestSeller testMethod=test_average_delay_carrier>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
_____________________ TestSeller.test_average_review_score _____________________
self = <tests.test_seller.TestSeller testMethod=test_average_review_score>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
________________________ TestSeller.test_average_sales _________________________
self = <tests.test_seller.TestSeller testMethod=test_average_sales>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
___________________________ TestSeller.test_columns ____________________________
self = <tests.test_seller.TestSeller testMethod=test_columns>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
___________________________ TestSeller.test_quantity ___________________________
self = <tests.test_seller.TestSeller testMethod=test_quantity>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
____________________________ TestSeller.test_shape _____________________________
self = <tests.test_seller.TestSeller testMethod=test_shape>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
_________________________ TestSeller.test_unique_state _________________________
self = <tests.test_seller.TestSeller testMethod=test_unique_state>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
__________________________ TestSeller.test_wait_time ___________________________
self = <tests.test_seller.TestSeller testMethod=test_wait_time>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
=========================== short test summary info ============================
FAILED tests/test_seller.py::TestSeller::test_average_delay_carrier - FileNot...
FAILED tests/test_seller.py::TestSeller::test_average_review_score - FileNotF...
FAILED tests/test_seller.py::TestSeller::test_average_sales - FileNotFoundErr...
FAILED tests/test_seller.py::TestSeller::test_columns - FileNotFoundError: [E...
FAILED tests/test_seller.py::TestSeller::test_quantity - FileNotFoundError: [...
FAILED tests/test_seller.py::TestSeller::test_shape - FileNotFoundError: [Err...
FAILED tests/test_seller.py::TestSeller::test_unique_state - FileNotFoundErro...
FAILED tests/test_seller.py::TestSeller::test_wait_time - FileNotFoundError: ...
============================== 8 failed in 0.16s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module product
product.py:42:0: C0301: Line too long (122/100) (line-too-long)
product.py:1:0: C0114: Missing module docstring (missing-module-docstring)
product.py:3:0: E0401: Unable to import 'olist.data' (import-error)
product.py:4:0: E0401: Unable to import 'olist.order' (import-error)
product.py:7:0: C0115: Missing class docstring (missing-class-docstring)
product.py:28:8: C0103: Variable name "df" doesn't conform to snake_case naming style (invalid-name)
product.py:53:8: C0103: Variable name "df" doesn't conform to snake_case naming style (invalid-name)
product.py:73:8: C0103: Variable name "df" doesn't conform to snake_case naming style (invalid-name)
product.py:75:8: C0103: Variable name "df" doesn't conform to snake_case naming style (invalid-name)
product.py:114:4: C0116: Missing function or method docstring (missing-function-docstring)
product.py:1:0: W0611: Unused pandas imported as pd (unused-import)
product.py:2:0: W0611: Unused numpy imported as np (unused-import)
------------------------------------------------------------------
Your code has been rated at 5.56/10 (previous run: 5.56/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products
collecting ... collected 4 items
tests/test_products.py::TestProducts::test_average_price FAILED [ 25%]
tests/test_products.py::TestProducts::test_average_quantity FAILED [ 50%]
tests/test_products.py::TestProducts::test_average_review_score FAILED [ 75%]
tests/test_products.py::TestProducts::test_shape FAILED [100%]
=================================== FAILURES ===================================
_______________________ TestProducts.test_average_price ________________________
self = <tests.test_products.TestProducts testMethod=test_average_price>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products/tests/products.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
______________________ TestProducts.test_average_quantity ______________________
self = <tests.test_products.TestProducts testMethod=test_average_quantity>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products/tests/products.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
____________________ TestProducts.test_average_review_score ____________________
self = <tests.test_products.TestProducts testMethod=test_average_review_score>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products/tests/products.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
___________________________ TestProducts.test_shape ____________________________
self = <tests.test_products.TestProducts testMethod=test_shape>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products/tests/products.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
=========================== short test summary info ============================
FAILED tests/test_products.py::TestProducts::test_average_price - FileNotFoun...
FAILED tests/test_products.py::TestProducts::test_average_quantity - FileNotF...
FAILED tests/test_products.py::TestProducts::test_average_review_score - File...
FAILED tests/test_products.py::TestProducts::test_shape - FileNotFoundError: ...
============================== 4 failed in 0.13s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module order_solution
order_solution.py:25:0: C0301: Line too long (116/100) (line-too-long)
order_solution.py:47:0: C0301: Line too long (107/100) (line-too-long)
order_solution.py:181:0: C0301: Line too long (103/100) (line-too-long)
order_solution.py:1:0: C0114: Missing module docstring (missing-module-docstring)
order_solution.py:4:0: E0401: Unable to import 'olist.utils' (import-error)
order_solution.py:5:0: E0401: Unable to import 'olist.data' (import-error)
order_solution.py:46:8: C0103: Argument name "x" doesn't conform to snake_case naming style (invalid-name)
order_solution.py:49:12: R1705: Unnecessary "else" after "return" (no-else-return)
order_solution.py:78:8: C0103: Argument name "d" doesn't conform to snake_case naming style (invalid-name)
order_solution.py:79:12: R1705: Unnecessary "else" after "return" (no-else-return)
order_solution.py:84:8: C0103: Argument name "d" doesn't conform to snake_case naming style (invalid-name)
order_solution.py:85:12: R1705: Unnecessary "else" after "return" (no-else-return)
order_solution.py:1:0: W0611: Unused import os (unused-import)
------------------------------------------------------------------
Your code has been rated at 7.08/10 (previous run: 7.08/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders
collecting ... collected 6 items
tests/test_reviews.py::TestReviews::test_dim_five_star FAILED [ 16%]
tests/test_reviews.py::TestReviews::test_dim_not_five_star FAILED [ 33%]
tests/test_reviews.py::TestReviews::test_dim_not_one_star FAILED [ 50%]
tests/test_reviews.py::TestReviews::test_dim_one_star FAILED [ 66%]
tests/test_training.py::TestTraining::test_training_data_columns FAILED [ 83%]
tests/test_training.py::TestTraining::test_training_data_shape FAILED [100%]
=================================== FAILURES ===================================
________________________ TestReviews.test_dim_five_star ________________________
self = <tests.test_reviews.TestReviews testMethod=test_dim_five_star>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/reviews.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
______________________ TestReviews.test_dim_not_five_star ______________________
self = <tests.test_reviews.TestReviews testMethod=test_dim_not_five_star>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/reviews.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
______________________ TestReviews.test_dim_not_one_star _______________________
self = <tests.test_reviews.TestReviews testMethod=test_dim_not_one_star>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/reviews.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
________________________ TestReviews.test_dim_one_star _________________________
self = <tests.test_reviews.TestReviews testMethod=test_dim_one_star>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/reviews.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
___________________ TestTraining.test_training_data_columns ____________________
self = <tests.test_training.TestTraining testMethod=test_training_data_columns>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/training.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
____________________ TestTraining.test_training_data_shape _____________________
self = <tests.test_training.TestTraining testMethod=test_training_data_shape>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/training.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
=========================== short test summary info ============================
FAILED tests/test_reviews.py::TestReviews::test_dim_five_star - FileNotFoundE...
FAILED tests/test_reviews.py::TestReviews::test_dim_not_five_star - FileNotFo...
FAILED tests/test_reviews.py::TestReviews::test_dim_not_one_star - FileNotFou...
FAILED tests/test_reviews.py::TestReviews::test_dim_one_star - FileNotFoundEr...
FAILED tests/test_training.py::TestTraining::test_training_data_columns - Fil...
FAILED tests/test_training.py::TestTraining::test_training_data_shape - FileN...
============================== 6 failed in 0.15s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/04-Logistic-Regression/01-Logit
collecting ... collected 2 items
tests/test_logit_five.py::TestLogitFive::test_intercept_five FAILED [ 50%]
tests/test_logit_one.py::TestLogitOne::test_intercept_one FAILED [100%]
=================================== FAILURES ===================================
______________________ TestLogitFive.test_intercept_five _______________________
self = <tests.test_logit_five.TestLogitFive testMethod=test_intercept_five>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/04-Logistic-Regression/01-Logit/tests/logit_five.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
_______________________ TestLogitOne.test_intercept_one ________________________
self = <tests.test_logit_one.TestLogitOne testMethod=test_intercept_one>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/04-Logistic-Regression/01-Logit/tests/logit_one.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
=========================== short test summary info ============================
FAILED tests/test_logit_five.py::TestLogitFive::test_intercept_five - FileNot...
FAILED tests/test_logit_one.py::TestLogitOne::test_intercept_one - FileNotFou...
============================== 2 failed in 0.13s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/Optional-Metric-Design
collecting ... collected 3 items
tests/test_orders.py::TestOrders::test_key_names FAILED [ 33%]
tests/test_orders.py::TestOrders::test_keys_len FAILED [ 66%]
tests/test_orders.py::TestOrders::test_reviews_number FAILED [100%]
=================================== FAILURES ===================================
__________________________ TestOrders.test_key_names ___________________________
self = <tests.test_orders.TestOrders testMethod=test_key_names>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/Optional-Metric-Design/tests/orders.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
___________________________ TestOrders.test_keys_len ___________________________
self = <tests.test_orders.TestOrders testMethod=test_keys_len>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/Optional-Metric-Design/tests/orders.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
________________________ TestOrders.test_reviews_number ________________________
self = <tests.test_orders.TestOrders testMethod=test_reviews_number>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/Optional-Metric-Design/tests/orders.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
=========================== short test summary info ============================
FAILED tests/test_orders.py::TestOrders::test_key_names - FileNotFoundError: ...
FAILED tests/test_orders.py::TestOrders::test_keys_len - FileNotFoundError: [...
FAILED tests/test_orders.py::TestOrders::test_reviews_number - FileNotFoundEr...
============================== 3 failed in 0.13s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/03-Exploratory-Analysis
collecting ... collected 2 items
tests/test_matching_table.py::TestMatchingTable::test_columns FAILED [ 50%]
tests/test_matching_table.py::TestMatchingTable::test_shape FAILED [100%]
=================================== FAILURES ===================================
________________________ TestMatchingTable.test_columns ________________________
self = <tests.test_matching_table.TestMatchingTable testMethod=test_columns>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/03-Exploratory-Analysis/tests/matching_table.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
_________________________ TestMatchingTable.test_shape _________________________
self = <tests.test_matching_table.TestMatchingTable testMethod=test_shape>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/03-Exploratory-Analysis/tests/matching_table.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
=========================== short test summary info ============================
FAILED tests/test_matching_table.py::TestMatchingTable::test_columns - FileNo...
FAILED tests/test_matching_table.py::TestMatchingTable::test_shape - FileNotF...
============================== 2 failed in 0.12s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module data_solution
data_solution.py:13:0: C0301: Line too long (129/100) (line-too-long)
data_solution.py:1:0: C0114: Missing module docstring (missing-module-docstring)
data_solution.py:5:0: C0115: Missing class docstring (missing-class-docstring)
data_solution.py:28:15: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
data_solution.py:6:4: R0201: Method could be a function (no-self-use)
data_solution.py:52:4: R0201: Method could be a function (no-self-use)
------------------------------------------------------------------
Your code has been rated at 7.14/10 (previous run: 7.14/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/02-Data-Preparation
collecting ... collected 3 items
tests/test_get_data.py::TestGetData::test_columns FAILED [ 33%]
tests/test_get_data.py::TestGetData::test_keys FAILED [ 66%]
tests/test_get_data.py::TestGetData::test_len FAILED [100%]
=================================== FAILURES ===================================
___________________________ TestGetData.test_columns ___________________________
self = <tests.test_get_data.TestGetData testMethod=test_columns>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/02-Data-Preparation/tests/get_data.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
____________________________ TestGetData.test_keys _____________________________
self = <tests.test_get_data.TestGetData testMethod=test_keys>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/02-Data-Preparation/tests/get_data.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
_____________________________ TestGetData.test_len _____________________________
self = <tests.test_get_data.TestGetData testMethod=test_len>
def setUp(self):
"""Load the pickle file"""
klass = self.__class__.__name__
name = re.sub(r'(?<!^)(?=[A-Z])', '_', klass).lower()[len('test_'):]
result_file = os.path.join(os.getcwd(), "tests", f"{name}.pickle")
> self.result = pickle.load(open(result_file, 'rb'))
E FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/02-Data-Preparation/tests/get_data.pickle'
/usr/local/lib/python3.9/site-packages/nbresult/__init__.py:52: FileNotFoundError
=========================== short test summary info ============================
FAILED tests/test_get_data.py::TestGetData::test_columns - FileNotFoundError:...
FAILED tests/test_get_data.py::TestGetData::test_keys - FileNotFoundError: [E...
FAILED tests/test_get_data.py::TestGetData::test_len - FileNotFoundError: [Er...
============================== 3 failed in 0.13s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/00-Warmup
collecting ... collected 5 items
tests/test_school.py::TestSchool::test_barcelona PASSED [ 20%]
tests/test_school.py::TestSchool::test_berlin PASSED [ 40%]
tests/test_school.py::TestSchool::test_brussels PASSED [ 60%]
tests/test_school.py::TestSchool::test_london PASSED [ 80%]
tests/test_school.py::TestSchool::test_paris PASSED [100%]
============================== 5 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 9.20/10, +0.80)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/03-Rank-And-Partition
collecting ... collected 2 items
tests/test_queries.py::TestQueries::test_order_cumulative_amount_per_customer PASSED [ 50%]
tests/test_queries.py::TestQueries::test_order_rank_per_customer PASSED [100%]
============================== 2 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/01-Query-the-DB
collecting ... collected 10 items
tests/test_get_orders_range.py::TestOrdersRange::test_len_results PASSED [ 10%]
tests/test_get_orders_range.py::TestOrdersRange::test_results_0 PASSED [ 20%]
tests/test_get_orders_range.py::TestOrdersRange::test_results_1 PASSED [ 30%]
tests/test_get_orders_range.py::TestOrdersRange::test_type_results PASSED [ 40%]
tests/test_get_waiting_time.py::TestWaitingTime::test_first_result PASSED [ 50%]
tests/test_get_waiting_time.py::TestWaitingTime::test_last_result PASSED [ 60%]
tests/test_get_waiting_time.py::TestWaitingTime::test_size_list PASSED [ 70%]
tests/test_get_waiting_time.py::TestWaitingTime::test_type_results PASSED [ 80%]
tests/test_query_orders.py::TestQueryOrders::test_first_element PASSED [ 90%]
tests/test_query_orders.py::TestQueryOrders::test_length_list PASSED [100%]
============================== 10 passed in 0.05s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/02-Join-the-tables
collecting ... collected 15 items
tests/test_best_employee.py::TestBestEmployee::test_good_result PASSED [ 6%]
tests/test_best_employee.py::TestBestEmployee::test_length_results PASSED [ 13%]
tests/test_best_employee.py::TestBestEmployee::test_type_result PASSED [ 20%]
tests/test_detailed_orders.py::TestDetailOrders::test_first_results PASSED [ 26%]
tests/test_detailed_orders.py::TestDetailOrders::test_last_results PASSED [ 33%]
tests/test_detailed_orders.py::TestDetailOrders::test_length_results PASSED [ 40%]
tests/test_detailed_orders.py::TestDetailOrders::test_type_results PASSED [ 46%]
tests/test_orders_per_customer.py::TestOrdersPerCustomer::test_first_result PASSED [ 53%]
tests/test_orders_per_customer.py::TestOrdersPerCustomer::test_last_result PASSED [ 60%]
tests/test_orders_per_customer.py::TestOrdersPerCustomer::test_length_results PASSED [ 66%]
tests/test_orders_per_customer.py::TestOrdersPerCustomer::test_type_result PASSED [ 73%]
tests/test_spent_per_customer.py::TestSpentCustomer::test_first_result PASSED [ 80%]
tests/test_spent_per_customer.py::TestSpentCustomer::test_last_result PASSED [ 86%]
tests/test_spent_per_customer.py::TestSpentCustomer::test_len_resultts PASSED [ 93%]
tests/test_spent_per_customer.py::TestSpentCustomer::test_type_results PASSED [100%]
============================== 15 passed in 0.06s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/04-Subquery-Refactoring
collecting ... collected 13 items
tests/test_average_number_of_days_between_orders.py::TestAverageNumberOfDaysBetweenOrders::test_result_type PASSED [ 7%]
tests/test_average_number_of_days_between_orders.py::TestAverageNumberOfDaysBetweenOrders::test_result_value PASSED [ 15%]
tests/test_average_per_customer.py::TestAveragePerCustomer::test_length_results PASSED [ 23%]
tests/test_average_per_customer.py::TestAveragePerCustomer::test_results PASSED [ 30%]
tests/test_average_per_customer.py::TestAveragePerCustomer::test_type_results PASSED [ 38%]
tests/test_best_customers.py::TestBestCustomers::test_length_results PASSED [ 46%]
tests/test_best_customers.py::TestBestCustomers::test_results PASSED [ 53%]
tests/test_best_customers.py::TestBestCustomers::test_type_results PASSED [ 61%]
tests/test_general_average.py::TestGeneralAverage::test_results PASSED [ 69%]
tests/test_general_average.py::TestGeneralAverage::test_type_results PASSED [ 76%]
tests/test_top_ordered_product_per_customer.py::TestTopOrderedProductPerCustomer::test_result_length PASSED [ 84%]
tests/test_top_ordered_product_per_customer.py::TestTopOrderedProductPerCustomer::test_result_type PASSED [ 92%]
tests/test_top_ordered_product_per_customer.py::TestTopOrderedProductPerCustomer::test_result_values PASSED [100%]
============================== 13 passed in 0.06s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/02-Data-Sourcing/02-API
collecting ... collected 8 items
tests/test_history.py::TestHistory::test_daily_forecast_london_for_january_first_2019 PASSED [ 12%]
tests/test_history.py::TestHistory::test_daily_forecast_paris_for_christmas_2015 PASSED [ 25%]
tests/test_history.py::TestHistory::test_monthly_forecast_london_for_february_2019 PASSED [ 37%]
tests/test_weather.py::TestWeather::test_search_city_ambiguous_city PASSED [ 50%]
tests/test_weather.py::TestWeather::test_search_city_for_london PASSED [ 62%]
tests/test_weather.py::TestWeather::test_search_city_for_paris PASSED [ 75%]
tests/test_weather.py::TestWeather::test_search_city_for_unknown_city PASSED [ 87%]
tests/test_weather.py::TestWeather::test_weather_forecast PASSED [100%]
============================== 8 passed in 17.79s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/02-Data-Sourcing/03-Scraping
collecting ... collected 1 item
tests/test_recipe.py::TestRecipe::test_parse_carrot PASSED [100%]
============================== 1 passed in 0.20s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/02-Data-Sourcing/Optional-01-Olympic-Winter-Games
collecting ... collected 4 items
tests/test_winter_olympic_games.py::TestWinterOlympicGames::test_country_with_most_gold_medals_between_1994_and_1998 PASSED [ 25%]
tests/test_winter_olympic_games.py::TestWinterOlympicGames::test_country_with_most_gold_medals_between_2002_and_2014 PASSED [ 50%]
tests/test_winter_olympic_games.py::TestWinterOlympicGames::test_most_decorated_athlete_ever PASSED [ 75%]
tests/test_winter_olympic_games.py::TestWinterOlympicGames::test_top_three_women_in_five_thousand_meters PASSED [100%]
============================== 4 passed in 0.12s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/05-SQL-Queries
collecting ... collected 18 items
tests/test_detailed_movies.py::TestDetailedMovies::test_first_element PASSED [ 5%]
tests/test_detailed_movies.py::TestDetailedMovies::test_is_list PASSED [ 11%]
tests/test_detailed_movies.py::TestDetailedMovies::test_len_each_tuple PASSED [ 16%]
tests/test_detailed_movies.py::TestDetailedMovies::test_length_list PASSED [ 22%]
tests/test_late_released_movies.py::TestLateReleasedMovies::test_first_element PASSED [ 27%]
tests/test_late_released_movies.py::TestLateReleasedMovies::test_is_list PASSED [ 33%]
tests/test_late_released_movies.py::TestLateReleasedMovies::test_length_list PASSED [ 38%]
tests/test_movie_duration_buckets.py::TestMovieDurationBuckets::test_movie_duration_buckets PASSED [ 44%]
tests/test_stats_on.py::TestStatsOn::test_is_dict PASSED [ 50%]
tests/test_stats_on.py::TestStatsOn::test_results_for_action_adv PASSED [ 55%]
tests/test_stats_on.py::TestStatsOn::test_results_for_drama PASSED [ 61%]
tests/test_top_five_directors_for.py::TestTopFiveDirectorsFor::test_return_5_results PASSED [ 66%]
tests/test_top_five_directors_for.py::TestTopFiveDirectorsFor::test_return_list PASSED [ 72%]
tests/test_top_five_directors_for.py::TestTopFiveDirectorsFor::test_return_right_results1 PASSED [ 77%]
tests/test_top_five_directors_for.py::TestTopFiveDirectorsFor::test_return_right_results2 PASSED [ 83%]
tests/test_top_five_youngest_newly_directors.py::TestTopFiveYoungestNewlyDirectors::test_first_element PASSED [ 88%]
tests/test_top_five_youngest_newly_directors.py::TestTopFiveYoungestNewlyDirectors::test_is_list PASSED [ 94%]
tests/test_top_five_youngest_newly_directors.py::TestTopFiveYoungestNewlyDirectors::test_length_list PASSED [100%]
============================== 18 passed in 0.17s ==============================
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/03-Interacting-with-db
collecting ... collected 4 items
tests/test_user.py::Users::test_directors_should_have_the_correct_fields FAILED [ 25%]
tests/test_user.py::Users::test_directors_table_exists FAILED [ 50%]
tests/test_user.py::Users::test_movies_should_have_the_correct_fields FAILED [ 75%]
tests/test_user.py::Users::test_movies_table_exists FAILED [100%]
=================================== FAILURES ===================================
_____________ Users.test_directors_should_have_the_correct_fields ______________
self = <tests.test_user.Users testMethod=test_directors_should_have_the_correct_fields>
def test_directors_should_have_the_correct_fields(self):
with open('movies.xml', 'r') as file:
data= file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10755e730>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>INTEGER</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x1072e04c0>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
______________________ Users.test_directors_table_exists _______________________
self = <tests.test_user.Users testMethod=test_directors_table_exists>
def test_directors_table_exists(self):
with open('movies.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x107547610>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>INTEGER</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x1075a8d30>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
_______________ Users.test_movies_should_have_the_correct_fields _______________
self = <tests.test_user.Users testMethod=test_movies_should_have_the_correct_fields>
def test_movies_should_have_the_correct_fields(self):
with open('movies.xml', 'r') as file:
data= file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x1075e87f0>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>INTEGER</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x1075a8e50>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
________________________ Users.test_movies_table_exists ________________________
self = <tests.test_user.Users testMethod=test_movies_table_exists>
def test_movies_table_exists(self):
with open('movies.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10760ba60>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>INTEGER</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x1075a8f70>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
=========================== short test summary info ============================
FAILED tests/test_user.py::Users::test_directors_should_have_the_correct_fields
FAILED tests/test_user.py::Users::test_directors_table_exists - bs4.FeatureNo...
FAILED tests/test_user.py::Users::test_movies_should_have_the_correct_fields
FAILED tests/test_user.py::Users::test_movies_table_exists - bs4.FeatureNotFo...
============================== 4 failed in 0.27s ===============================
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/02-DB-Design
collecting ... collected 6 items
tests/test_user.py::Users::test_movies_should_have_the_correct_fields FAILED [ 16%]
tests/test_user.py::Users::test_movies_table_exists FAILED [ 33%]
tests/test_user.py::Users::test_users_should_have_the_correct_fields FAILED [ 50%]
tests/test_user.py::Users::test_users_table_exists FAILED [ 66%]
tests/test_user.py::Users::test_views_should_have_the_correct_fields FAILED [ 83%]
tests/test_user.py::Users::test_views_table_exists FAILED [100%]
=================================== FAILURES ===================================
_______________ Users.test_movies_should_have_the_correct_fields _______________
self = <tests.test_user.Users testMethod=test_movies_should_have_the_correct_fields>
def test_movies_should_have_the_correct_fields(self):
with open('movies.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e935fd0>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e6ab550>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
________________________ Users.test_movies_table_exists ________________________
self = <tests.test_user.Users testMethod=test_movies_table_exists>
def test_movies_table_exists(self):
with open('movies.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e968c40>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e842310>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
_______________ Users.test_users_should_have_the_correct_fields ________________
self = <tests.test_user.Users testMethod=test_users_should_have_the_correct_fields>
def test_users_should_have_the_correct_fields(self):
with open('movies.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10ea1caf0>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e9750d0>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
________________________ Users.test_users_table_exists _________________________
self = <tests.test_user.Users testMethod=test_users_table_exists>
def test_users_table_exists(self):
with open('movies.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:11:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e9b8a90>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e975ca0>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
_______________ Users.test_views_should_have_the_correct_fields ________________
self = <tests.test_user.Users testMethod=test_views_should_have_the_correct_fields>
def test_views_should_have_the_correct_fields(self):
with open('movies.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:63:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e968550>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e975af0>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
________________________ Users.test_views_table_exists _________________________
self = <tests.test_user.Users testMethod=test_views_table_exists>
def test_views_table_exists(self):
with open('movies.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e9d6ac0>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e9750d0>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
=========================== short test summary info ============================
FAILED tests/test_user.py::Users::test_movies_should_have_the_correct_fields
FAILED tests/test_user.py::Users::test_movies_table_exists - bs4.FeatureNotFo...
FAILED tests/test_user.py::Users::test_users_should_have_the_correct_fields
FAILED tests/test_user.py::Users::test_users_table_exists - bs4.FeatureNotFou...
FAILED tests/test_user.py::Users::test_views_should_have_the_correct_fields
FAILED tests/test_user.py::Users::test_views_table_exists - bs4.FeatureNotFou...
============================== 6 failed in 0.31s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module queries
queries.py:27:0: C0301: Line too long (110/100) (line-too-long)
queries.py:52:0: C0301: Line too long (109/100) (line-too-long)
-------------------------------------------------------------------
Your code has been rated at 9.20/10 (previous run: 10.00/10, -0.80)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/04-Interacting-With-Code
collecting ... collected 6 items
tests/test_user.py::QueriesMethods::test_directors_count PASSED [ 16%]
tests/test_user.py::QueriesMethods::test_directors_list PASSED [ 33%]
tests/test_user.py::QueriesMethods::test_directors_named_like_count PASSED [ 50%]
tests/test_user.py::QueriesMethods::test_input_escaping PASSED [ 66%]
tests/test_user.py::QueriesMethods::test_love_movies PASSED [ 83%]
tests/test_user.py::QueriesMethods::test_movies_longer_than PASSED [100%]
============================== 6 passed in 0.39s ===============================
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/01-Table-Design
collecting ... collected 3 items
tests/test_user.py::Users::test_should_have_the_correct_fields FAILED [ 33%]
tests/test_user.py::Users::test_should_only_have_users_table FAILED [ 66%]
tests/test_user.py::Users::test_users_table_exists FAILED [100%]
=================================== FAILURES ===================================
__________________ Users.test_should_have_the_correct_fields ___________________
self = <tests.test_user.Users testMethod=test_should_have_the_correct_fields>
def test_should_have_the_correct_fields(self):
with open('users.xml', 'r') as file:
data= file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x1053f5b20>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>VARCHAR</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x105178550>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
___________________ Users.test_should_only_have_users_table ____________________
self = <tests.test_user.Users testMethod=test_should_only_have_users_table>
def test_should_only_have_users_table(self):
with open('users.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x1054799d0>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>VARCHAR</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x105316dc0>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
________________________ Users.test_users_table_exists _________________________
self = <tests.test_user.Users testMethod=test_users_table_exists>
def test_users_table_exists(self):
with open('users.xml', 'r') as file:
data = file.read().replace('\n', '')
> soup = BeautifulSoup(data, 'xml')
tests/test_user.py:11:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x1054f83d0>
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>VARCHAR</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>'
features = ['xml'], builder = None, parse_only = None, from_encoding = None
exclude_encodings = None, element_classes = None, kwargs = {}
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x105316d30>
original_builder = None, original_features = 'xml', builder_class = None
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, exclude_encodings=None,
element_classes=None, **kwargs):
"""Constructor.

 :param markup: A string or a file-like object representing
 markup to be parsed.

 :param features: Desirable features of the parser to be
 used. This may be the name of a specific parser ("lxml",
 "lxml-xml", "html.parser", or "html5lib") or it may be the
 type of markup to be used ("html", "html5", "xml"). It's
 recommended that you name a specific parser, so that
 Beautiful Soup gives you the same results across platforms
 and virtual environments.

 :param builder: A TreeBuilder subclass to instantiate (or
 instance to use) instead of looking one up based on
 `features`. You only need to use this if you've implemented a
 custom TreeBuilder.

 :param parse_only: A SoupStrainer. Only parts of the document
 matching the SoupStrainer will be considered. This is useful
 when parsing part of a document that would otherwise be too
 large to fit into memory.

 :param from_encoding: A string indicating the encoding of the
 document to be parsed. Pass this in if Beautiful Soup is
 guessing wrongly about the document's encoding.

 :param exclude_encodings: A list of strings indicating
 encodings known to be wrong. Pass this in if you don't know
 the document's encoding but you know Beautiful Soup's guess is
 wrong.

 :param element_classes: A dictionary mapping BeautifulSoup
 classes like Tag and NavigableString, to other classes you'd
 like to be instantiated instead as the parse tree is
 built. This is useful for subclassing Tag or NavigableString
 to modify default behavior.

 :param kwargs: For backwards compatibility purposes, the
 constructor accepts certain keyword arguments used in
 Beautiful Soup 3. None of these arguments do anything in
 Beautiful Soup 4; they will result in a warning and then be
 ignored.

 Apart from this, any keyword arguments passed into the
 BeautifulSoup constructor are propagated to the TreeBuilder
 constructor. This makes it possible to configure a
 TreeBuilder by passing in arguments, not just by saying which
 one to use.
 """
if 'convertEntities' in kwargs:
del kwargs['convertEntities']
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. Suggest you use "
"features='lxml' for HTML and features='lxml-xml' for "
"XML.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if from_encoding and isinstance(markup, str):
warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")
from_encoding = None
self.element_classes = element_classes or dict()
# We need this information to track whether or not the builder
# was specified well enough that we can omit the 'you need to
# specify a parser' warning.
original_builder = builder
original_features = features
if isinstance(builder, type):
# A builder class was passed in; it needs to be instantiated.
builder_class = builder
builder = None
elif builder is None:
if isinstance(features, str):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
> raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
E bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?
/usr/local/lib/python3.9/site-packages/bs4/__init__.py:243: FeatureNotFound
=========================== short test summary info ============================
FAILED tests/test_user.py::Users::test_should_have_the_correct_fields - bs4.F...
FAILED tests/test_user.py::Users::test_should_only_have_users_table - bs4.Fea...
FAILED tests/test_user.py::Users::test_users_table_exists - bs4.FeatureNotFou...
============================== 3 failed in 0.24s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module calc
calc.py:69:0: C0305: Trailing newlines (trailing-newlines)
------------------------------------------------------------------
Your code has been rated at 9.66/10 (previous run: 9.66/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/02-System-Parameters
collecting ... collected 3 items
tests/test_calc.py::TestCalc::test_2_times_6 PASSED [ 33%]
tests/test_calc.py::TestCalc::test_3_minus_9 PASSED [ 66%]
tests/test_calc.py::TestCalc::test_4_plus_5 PASSED [100%]
============================== 3 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module currencies
currencies.py:12:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
------------------------------------------------------------------
Your code has been rated at 8.57/10 (previous run: 8.57/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/06-Data-Structures
collecting ... collected 5 items
tests/test_currencies.py::TestStrings::test_convert_chf_to_eur PASSED [ 20%]
tests/test_currencies.py::TestStrings::test_convert_eur_to_gbp PASSED [ 40%]
tests/test_currencies.py::TestStrings::test_convert_gbp_to_eur PASSED [ 60%]
tests/test_currencies.py::TestStrings::test_convert_usd_to_eur PASSED [ 80%]
tests/test_currencies.py::TestStrings::test_should_handle_a_missing_rate PASSED [100%]
============================== 5 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/05-String-Manipulation
collecting ... collected 15 items
tests/test_string_methods.py::TestStrings::test_casanova_to_cosonovo PASSED [ 6%]
tests/test_string_methods.py::TestStrings::test_do_not_include_word PASSED [ 13%]
tests/test_string_methods.py::TestStrings::test_include_word PASSED [ 20%]
tests/test_string_methods.py::TestStrings::test_is_a_question PASSED [ 26%]
tests/test_string_methods.py::TestStrings::test_is_not_a_question PASSED [ 33%]
tests/test_string_methods.py::TestStrings::test_john_doe_33_concatenation PASSED [ 40%]
tests/test_string_methods.py::TestStrings::test_john_doe_33_formatting PASSED [ 46%]
tests/test_string_methods.py::TestStrings::test_kosovo_to_kasava PASSED [ 53%]
tests/test_string_methods.py::TestStrings::test_leading_whitespaces PASSED [ 60%]
tests/test_string_methods.py::TestStrings::test_numbers_0_0_1_2_0_on_0 PASSED [ 66%]
tests/test_string_methods.py::TestStrings::test_numbers_0_0_1_2_0_on_3 PASSED [ 73%]
tests/test_string_methods.py::TestStrings::test_strings_boris_romain_seb PASSED [ 80%]
tests/test_string_methods.py::TestStrings::test_strings_boris_seb_romain PASSED [ 86%]
tests/test_string_methods.py::TestStrings::test_trailing_whitespaces PASSED [ 93%]
tests/test_string_methods.py::TestStrings::test_whitespaces PASSED [100%]
============================== 15 passed in 0.06s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/01-Sum-Of-Three
collecting ... collected 3 items
tests/test_sum_of_three.py::TestSumOfThree::test_numbers_0_0_0 PASSED [ 33%]
tests/test_sum_of_three.py::TestSumOfThree::test_numbers_1_2_3 PASSED [ 66%]
tests/test_sum_of_three.py::TestSumOfThree::test_with_negative_numbers PASSED [100%]
============================== 3 passed in 0.03s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module flask_option
flask_option.py:8:0: W0311: Bad indentation. Found 6 spaces, expected 8 (bad-indentation)
------------------------------------------------------------------
Your code has been rated at 8.75/10 (previous run: 8.75/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/03-Environment
collecting ... collected 3 items
tests/test_flask_option.py::TestFlaskOption::test_start_with_flask_env_development PASSED [ 33%]
tests/test_flask_option.py::TestFlaskOption::test_start_with_flask_env_production PASSED [ 66%]
tests/test_flask_option.py::TestFlaskOption::test_start_with_no_flask_env PASSED [100%]
============================== 3 passed in 0.04s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/08-Optional-Sudoku-Solver
collecting ... collected 4 items
tests/test_sudoku.py::SudokuSolverTest::test_incorrect_grid PASSED [ 25%]
tests/test_sudoku.py::SudokuSolverTest::test_incorrect_grid_2 PASSED [ 50%]
tests/test_sudoku.py::SudokuSolverTest::test_incorrect_grid_3 PASSED [ 75%]
tests/test_sudoku.py::SudokuSolverTest::test_valid_grid PASSED [100%]
============================== 4 passed in 0.05s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/07-Optional-Sudoku
collecting ... collected 4 items
tests/test_sudoku.py::SudokuValidatorTest::test_invalid_grid PASSED [ 25%]
tests/test_sudoku.py::SudokuValidatorTest::test_invalid_grid2 PASSED [ 50%]
tests/test_sudoku.py::SudokuValidatorTest::test_invalid_grid_column PASSED [ 75%]
tests/test_sudoku.py::SudokuValidatorTest::test_valid_grid PASSED [100%]
============================== 4 passed in 0.05s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/04-Debugging
collecting ... collected 4 items
tests/test_hello.py::TestHello::test_empty_arguments PASSED [ 25%]
tests/test_hello.py::TestHello::test_happy_path PASSED [ 50%]
tests/test_hello.py::TestHello::test_only_first_name PASSED [ 75%]
tests/test_hello.py::TestHello::test_only_last_name PASSED [100%]
============================== 4 passed in 0.05s ===============================
Requirement already satisfied: streamlit in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (0.74.1)
Requirement already satisfied: numpy in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (1.19.5)
Requirement already satisfied: astor in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (0.8.1)
Requirement already satisfied: requests in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (2.25.1)
Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (7.1.2)
Requirement already satisfied: toml in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (0.10.2)
Requirement already satisfied: cachetools>=4.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (4.2.0)
Requirement already satisfied: protobuf!=3.11,>=3.6.0 in /usr/local/Cellar/protobuf/3.14.0/libexec/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (3.14.0)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (2.8.1)
Requirement already satisfied: tornado>=5.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (6.1)
Requirement already satisfied: base58 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (8.1.0)
Requirement already satisfied: gitpython in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (3.1.12)
Requirement already satisfied: altair>=3.2.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (4.1.0)
Requirement already satisfied: packaging in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (20.8)
Requirement already satisfied: validators in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (0.18.2)
Requirement already satisfied: tzlocal in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (2.1)
Requirement already satisfied: pandas>=0.21.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (1.2.0)
Requirement already satisfied: blinker in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (1.4)
Requirement already satisfied: pydeck>=0.1.dev5 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (0.5.0)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.9/site-packages (from altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (2.11.2)
Requirement already satisfied: jsonschema in /usr/local/lib/python3.9/site-packages (from altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (3.2.0)
Requirement already satisfied: toolz in /usr/local/lib/python3.9/site-packages (from altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (0.11.1)
Requirement already satisfied: entrypoints in /usr/local/lib/python3.9/site-packages (from altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (0.3)
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.9/site-packages (from pandas>=0.21.0->streamlit->-r requirements.txt (line 1)) (2020.5)
Requirement already satisfied: six>=1.9 in /usr/local/Cellar/protobuf/3.14.0/libexec/lib/python3.9/site-packages (from protobuf!=3.11,>=3.6.0->streamlit->-r requirements.txt (line 1)) (1.15.0)
Requirement already satisfied: traitlets>=4.3.2 in /usr/local/lib/python3.9/site-packages (from pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (5.0.5)
Requirement already satisfied: ipywidgets>=7.0.0 in /usr/local/lib/python3.9/site-packages (from pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (7.6.3)
Requirement already satisfied: ipykernel>=5.1.2 in /usr/local/lib/python3.9/site-packages (from pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (5.4.3)
Requirement already satisfied: appnope in /usr/local/lib/python3.9/site-packages (from ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.1.2)
Requirement already satisfied: jupyter-client in /usr/local/lib/python3.9/site-packages (from ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (6.1.11)
Requirement already satisfied: ipython>=5.0.0 in /usr/local/lib/python3.9/site-packages (from ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (7.19.0)
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (51.3.3)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (3.0.10)
Requirement already satisfied: pygments in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (2.7.4)
Requirement already satisfied: backcall in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.2.0)
Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (4.8.0)
Requirement already satisfied: decorator in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (4.4.2)
Requirement already satisfied: pickleshare in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.7.5)
Requirement already satisfied: jedi>=0.10 in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.18.0)
Requirement already satisfied: widgetsnbextension~=3.5.0 in /usr/local/lib/python3.9/site-packages (from ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (3.5.1)
Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.9/site-packages (from ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.0.0)
Requirement already satisfied: nbformat>=4.2.0 in /usr/local/lib/python3.9/site-packages (from ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (5.1.2)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.9/site-packages (from jedi>=0.10->ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.8.1)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.9/site-packages (from jinja2->altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (1.1.1)
Requirement already satisfied: jupyter-core in /usr/local/lib/python3.9/site-packages (from nbformat>=4.2.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (4.7.0)
Requirement already satisfied: ipython-genutils in /usr/local/lib/python3.9/site-packages (from nbformat>=4.2.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.2.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/lib/python3.9/site-packages (from jsonschema->altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (0.17.3)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.9/site-packages (from jsonschema->altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (20.3.0)
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.9/site-packages (from pexpect>4.3->ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.7.0)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.9/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.2.5)
Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.9/site-packages (from widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (6.2.0)
Requirement already satisfied: prometheus-client in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.9.0)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.9.2)
Requirement already satisfied: nbconvert in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (6.0.7)
Requirement already satisfied: pyzmq>=17 in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (21.0.1)
Requirement already satisfied: Send2Trash>=1.5.0 in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.5.0)
Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (20.1.0)
Requirement already satisfied: cffi>=1.0.0 in /usr/local/lib/python3.9/site-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.14.4)
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/site-packages (from cffi>=1.0.0->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (2.20)
Requirement already satisfied: gitdb<5,>=4.0.1 in /usr/local/lib/python3.9/site-packages (from gitpython->streamlit->-r requirements.txt (line 1)) (4.0.5)
Requirement already satisfied: smmap<4,>=3.0.1 in /usr/local/lib/python3.9/site-packages (from gitdb<5,>=4.0.1->gitpython->streamlit->-r requirements.txt (line 1)) (3.0.4)
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.5.1)
Requirement already satisfied: testpath in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.4.4)
Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.8.4)
Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.1.2)
Requirement already satisfied: bleach in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (3.2.1)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.4.3)
Requirement already satisfied: defusedxml in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.6.0)
Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.4.3)
Requirement already satisfied: async-generator in /usr/local/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.10)
Requirement already satisfied: webencodings in /usr/local/lib/python3.9/site-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.5.1)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.9/site-packages (from packaging->streamlit->-r requirements.txt (line 1)) (2.4.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests->streamlit->-r requirements.txt (line 1)) (2020.12.5)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests->streamlit->-r requirements.txt (line 1)) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests->streamlit->-r requirements.txt (line 1)) (1.26.2)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.9/site-packages (from requests->streamlit->-r requirements.txt (line 1)) (4.0.0)
Requirement already satisfied: pytz in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (2020.5)
Collecting category_encoders==2.2.2
Using cached category_encoders-2.2.2-py2.py3-none-any.whl (80 kB)
Collecting flask==1.1.1
Using cached Flask-1.1.1-py2.py3-none-any.whl (94 kB)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python3.9/site-packages (from flask==1.1.1->-r requirements.txt (line 16)) (7.1.2)
Requirement already satisfied: Jinja2>=2.10.1 in /usr/local/lib/python3.9/site-packages (from flask==1.1.1->-r requirements.txt (line 16)) (2.11.2)
Collecting gcsfs==0.6.0
Using cached gcsfs-0.6.0-py2.py3-none-any.whl (17 kB)
Requirement already satisfied: requests in /usr/local/lib/python3.9/site-packages (from gcsfs==0.6.0->-r requirements.txt (line 2)) (2.25.1)
Requirement already satisfied: decorator in /usr/local/lib/python3.9/site-packages (from gcsfs==0.6.0->-r requirements.txt (line 2)) (4.4.2)
Collecting google-cloud-storage==1.26.0
Using cached google_cloud_storage-1.26.0-py2.py3-none-any.whl (75 kB)
Collecting joblib==0.14.1
Using cached joblib-0.14.1-py2.py3-none-any.whl (294 kB)
Collecting memoized-property==1.0.3
Using cached memoized-property-1.0.3.tar.gz (5.0 kB)
Collecting mlflow==1.8.0
Using cached mlflow-1.8.0-py3-none-any.whl (10.4 MB)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (2.8.1)
Requirement already satisfied: entrypoints in /usr/local/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (0.3)
Requirement already satisfied: protobuf>=3.6.0 in /usr/local/Cellar/protobuf/3.14.0/libexec/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (3.14.0)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (5.3.1)
Requirement already satisfied: six>=1.10.0 in /usr/local/Cellar/protobuf/3.14.0/libexec/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (1.15.0)
Requirement already satisfied: gitpython>=2.1.0 in /usr/local/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (3.1.12)
Collecting numpy==1.18.4
Using cached numpy-1.18.4.zip (5.4 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'error'
gcloud ai-platform jobs submit training taxi_fare_model_20210119_160827 \
--job-dir gs://wagon-ml/trainings \
--package-path trainer \
--module-name trainer.task \
--python-version=3.5 \
--runtime-version=1.14 \
--region europe-west1
gcloud ai-platform jobs submit training taxi_fare_model_training_20210119_160827 \
--job-dir gs://taxi-fare-model-999/trainings \
--package-path TaxiFareModel \
--module-name TaxiFareModel.trainer \
--python-version=3.5 \
--runtime-version=1.14 \
--region europe-west1
gcloud ai-platform jobs submit training taxi_fare_model_20210119_160829 \
--job-dir gs://wagon-ml/trainings \
--package-path trainer \
--module-name trainer.task \
--python-version=3.5 \
--runtime-version=1.14 \
--region europe-west1
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module pythagore
pythagore.py:10:4: W0101: Unreachable code (unreachable)
pythagore.py:10:4: W0107: Unnecessary pass statement (unnecessary-pass)
************* Module euclidean_distance_2d
euclidean_distance_2d.py:11:4: W0101: Unreachable code (unreachable)
euclidean_distance_2d.py:11:4: W0107: Unnecessary pass statement (unnecessary-pass)
euclidean_distance_2d.py:25:4: W0101: Unreachable code (unreachable)
euclidean_distance_2d.py:25:4: W0107: Unnecessary pass statement (unnecessary-pass)
euclidean_distance_2d.py:37:4: W0101: Unreachable code (unreachable)
euclidean_distance_2d.py:37:4: W0107: Unnecessary pass statement (unnecessary-pass)
euclidean_distance_2d.py:45:4: C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate)
euclidean_distance_2d.py:48:4: W0101: Unreachable code (unreachable)
euclidean_distance_2d.py:48:4: W0107: Unnecessary pass statement (unnecessary-pass)
euclidean_distance_2d.py:63:4: W0101: Unreachable code (unreachable)
euclidean_distance_2d.py:63:4: W0107: Unnecessary pass statement (unnecessary-pass)
************* Module euclidean_distance_3d
euclidean_distance_3d.py:22:0: C0305: Trailing newlines (trailing-newlines)
euclidean_distance_3d.py:10:4: W0101: Unreachable code (unreachable)
euclidean_distance_3d.py:10:4: W0107: Unnecessary pass statement (unnecessary-pass)
euclidean_distance_3d.py:21:4: W0101: Unreachable code (unreachable)
euclidean_distance_3d.py:21:4: W0107: Unnecessary pass statement (unnecessary-pass)
************* Module euclidean_distance_nd
euclidean_distance_nd.py:15:0: C0305: Trailing newlines (trailing-newlines)
euclidean_distance_nd.py:14:4: W0101: Unreachable code (unreachable)
euclidean_distance_nd.py:14:4: W0107: Unnecessary pass statement (unnecessary-pass)
------------------------------------------------------------------
Your code has been rated at 6.82/10 (previous run: 6.82/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/Hidden-euclidean-distance
collecting ... collected 23 items
tests/test_distance_3d.py::TestDistance3D::test_points_in_sphere FAILED [ 4%]
tests/test_distance_3d.py::TestDistance3D::test_result_1 PASSED [ 8%]
tests/test_distance_3d.py::TestDistance3D::test_same_point PASSED [ 13%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_error_result PASSED [ 17%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_hypotenuse_result PASSED [ 21%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_hypotenuse_same_line PASSED [ 26%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_hypotenuse_same_point PASSED [ 30%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_negative_value PASSED [ 34%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_no_error PASSED [ 39%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_origine PASSED [ 43%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_p2d_test1 PASSED [ 47%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_p2d_test2 PASSED [ 52%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_p2d_zero PASSED [ 56%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_points_in_circle PASSED [ 60%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_same_point PASSED [ 65%]
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_x_axis PASSED [ 69%]
tests/test_euclidean_distance_nd.py::TestDistanceND::test_100d_pointst PASSED [ 73%]
tests/test_euclidean_distance_nd.py::TestDistanceND::test_10d_pointst PASSED [ 78%]
tests/test_euclidean_distance_nd.py::TestDistanceND::test_same_point PASSED [ 82%]
tests/test_pythagore.py::TestDebugMatrix::test_negative_value PASSED [ 86%]
tests/test_pythagore.py::TestDebugMatrix::test_result PASSED [ 91%]
tests/test_pythagore.py::TestDebugMatrix::test_string_value PASSED [ 95%]
tests/test_pythagore.py::TestDebugMatrix::test_zero_value PASSED [100%]
=================================== FAILURES ===================================
_____________________ TestDistance3D.test_points_in_sphere _____________________
self = <tests.test_distance_3d.TestDistance3D testMethod=test_points_in_sphere>
def test_points_in_sphere(self):
random.seed(1)
R = 4
X = []
C = (0, 0, 0)
for i in range(100):
x = round(random.uniform(-R, R), 2)
y = round(random.uniform(-R, R), 2)
z = round(random.uniform(-R, R), 2)
X.append([x, y, z])
results = points_in_sphere(X, C, R)
expected = [[-1.96, -0.04, -0.4], [0.33, 3.51, -0.95], [-2.23, -0.5, -0.03], [-2.14, -2.15, -2.25]]
fig = plt.figure()
ax = Axes3D(fig)
> ax.set_aspect("equal")
tests/test_distance_3d.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <mpl_toolkits.mplot3d.axes3d.Axes3D object at 0x10c2047c0>
aspect = 'equal', adjustable = None, anchor = None, share = False
def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
"""
 Set the aspect ratios.

 Axes 3D does not current support any aspect but 'auto' which fills
 the axes with the data limits.

 To simulate having equal aspect in data space, set the ratio
 of your data limits to match the value of `~.get_box_aspect`.
 To control box aspect ratios use `~.Axes3D.set_box_aspect`.

 Parameters
 ----------
 aspect : {'auto'}
 Possible values:

 ========= ==================================================
 value description
 ========= ==================================================
 'auto' automatic; fill the position rectangle with data.
 ========= ==================================================

 adjustable : None
 Currently ignored by Axes3D

 If not *None*, this defines which parameter will be adjusted to
 meet the required aspect. See `.set_adjustable` for further
 details.

 anchor : None or str or 2-tuple of float, optional
 If not *None*, this defines where the Axes will be drawn if there
 is extra space due to aspect constraints. The most common way to
 to specify the anchor are abbreviations of cardinal directions:

 ===== =====================
 value description
 ===== =====================
 'C' centered
 'SW' lower left corner
 'S' middle of bottom edge
 'SE' lower right corner
 etc.
 ===== =====================

 See `.set_anchor` for further details.

 share : bool, default: False
 If ``True``, apply the settings to all shared Axes.

 See Also
 --------
 mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect
 """
if aspect != 'auto':
> raise NotImplementedError(
"Axes3D currently only supports the aspect argument "
f"'auto'. You passed in {aspect!r}."
)
E NotImplementedError: Axes3D currently only supports the aspect argument 'auto'. You passed in 'equal'.
/usr/local/lib/python3.9/site-packages/mpl_toolkits/mplot3d/axes3d.py:323: NotImplementedError
=========================== short test summary info ============================
FAILED tests/test_distance_3d.py::TestDistance3D::test_points_in_sphere - Not...
=================== 1 failed, 22 passed in 65.53s (0:01:05) ====================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module basic_functions
basic_functions.py:6:4: W0101: Unreachable code (unreachable)
basic_functions.py:6:4: W0107: Unnecessary pass statement (unnecessary-pass)
basic_functions.py:13:4: W0101: Unreachable code (unreachable)
basic_functions.py:13:4: W0107: Unnecessary pass statement (unnecessary-pass)
basic_functions.py:41:4: W0101: Unreachable code (unreachable)
basic_functions.py:41:4: W0107: Unnecessary pass statement (unnecessary-pass)
************* Module addition
addition.py:20:4: W0101: Unreachable code (unreachable)
addition.py:20:4: W0107: Unnecessary pass statement (unnecessary-pass)
************* Module transpose
transpose.py:8:4: C0103: Variable name "N" doesn't conform to snake_case naming style (invalid-name)
transpose.py:8:7: C0103: Variable name "M" doesn't conform to snake_case naming style (invalid-name)
transpose.py:9:4: C0103: Variable name "B" doesn't conform to snake_case naming style (invalid-name)
transpose.py:14:4: W0101: Unreachable code (unreachable)
transpose.py:14:4: W0107: Unnecessary pass statement (unnecessary-pass)
transpose.py:3:0: W0611: Unused print_matrix imported from basic_functions (unused-import)
************* Module product
product.py:23:4: W0101: Unreachable code (unreachable)
product.py:23:4: W0107: Unnecessary pass statement (unnecessary-pass)
------------------------------------------------------------------
Your code has been rated at 7.71/10 (previous run: 5.56/10, +2.16)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/Hidden-linear-algebra
collecting ... collected 18 items
tests/test_addition.py::TestDebugMatrix::test_result PASSED [ 5%]
tests/test_addition.py::TestDebugMatrix::test_size_error PASSED [ 11%]
tests/test_basic_functions.py::TestDebugMatrix::test_M_00 PASSED [ 16%]
tests/test_basic_functions.py::TestDebugMatrix::test_M_12 PASSED [ 22%]
tests/test_basic_functions.py::TestDebugMatrix::test_M_ij_out_of_range PASSED [ 27%]
tests/test_basic_functions.py::TestDebugMatrix::test_add_one2M PASSED [ 33%]
tests/test_basic_functions.py::TestDebugMatrix::test_double_zeros PASSED [ 38%]
tests/test_basic_functions.py::TestDebugMatrix::test_get_column PASSED [ 44%]
tests/test_basic_functions.py::TestDebugMatrix::test_get_column_out_of_range PASSED [ 50%]
tests/test_basic_functions.py::TestDebugMatrix::test_multiply_M PASSED [ 55%]
tests/test_basic_functions.py::TestDebugMatrix::test_size_11 PASSED [ 61%]
tests/test_basic_functions.py::TestDebugMatrix::test_size_M PASSED [ 66%]
tests/test_multiplication.py::TestDebugMatrix::test_result PASSED [ 72%]
tests/test_multiplication.py::TestDebugMatrix::test_size_error PASSED [ 77%]
tests/test_transpose.py::TestTranspose::test_non_square_matrix PASSED [ 83%]
tests/test_transpose.py::TestTranspose::test_square_matrix PASSED [ 88%]
tests/test_transpose.py::TestTranspose::test_transpose_col PASSED [ 94%]
tests/test_transpose.py::TestTranspose::test_transpose_row PASSED [100%]
============================== 18 passed in 0.11s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/03-Scipy
collecting ... collected 13 items
tests/test_global_optimization.py::TestGlobalOptimization::test_bounds_values PASSED [ 7%]
tests/test_global_optimization.py::TestGlobalOptimization::test_minimum_dual_shape PASSED [ 15%]
tests/test_global_optimization.py::TestGlobalOptimization::test_minimum_dual_values PASSED [ 23%]
tests/test_global_optimization.py::TestGlobalOptimization::test_minimum_shgo_shape PASSED [ 30%]
tests/test_global_optimization.py::TestGlobalOptimization::test_minimum_shgo_values PASSED [ 38%]
tests/test_minimize2d.py::TestMinimize2d::test_minimum_shape PASSED [ 46%]
tests/test_minimize2d.py::TestMinimize2d::test_starting_point_shape PASSED [ 53%]
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_bounds_values PASSED [ 61%]
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_first_constraint PASSED [ 69%]
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_minimum_shape PASSED [ 76%]
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_second_constraint PASSED [ 84%]
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_starting_point_shape PASSED [ 92%]
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_third_constraint PASSED [100%]
============================== 13 passed in 0.26s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/01-real-estate-estimator
collecting ... collected 6 items
tests/test_features.py::TestFeatures::test_X_shape PASSED [ 16%]
tests/test_features.py::TestFeatures::test_features_order PASSED [ 33%]
tests/test_features.py::TestFeatures::test_x0_is_ones PASSED [ 50%]
tests/test_solution.py::TestSolution::test_theta0_is_positive PASSED [ 66%]
tests/test_solution.py::TestSolution::test_theta_shape PASSED [ 83%]
tests/test_target.py::TestTarget::test_shape PASSED [100%]
============================== 6 passed in 0.15s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/02-real-estate-advanced-estimator
collecting ... collected 6 items
tests/test_flats.py::TestFlats::test_columns PASSED [ 16%]
tests/test_flats.py::TestFlats::test_shape PASSED [ 33%]
tests/test_univariate.py::TestUnivariate::test_best_intercept PASSED [ 50%]
tests/test_univariate.py::TestUnivariate::test_best_slope PASSED [ 66%]
tests/test_univariate.py::TestUnivariate::test_mse PASSED [ 83%]
tests/test_univariate.py::TestUnivariate::test_squared_errors PASSED [100%]
============================== 6 passed in 0.56s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module basic_functions
basic_functions.py:1:0: C0114: Missing module docstring (missing-module-docstring)
basic_functions.py:1:0: C0116: Missing function or method docstring (missing-function-docstring)
basic_functions.py:1:12: W0613: Unused argument 'samples' (unused-argument)
basic_functions.py:5:0: C0116: Missing function or method docstring (missing-function-docstring)
basic_functions.py:5:26: W0613: Unused argument 'samples' (unused-argument)
basic_functions.py:9:0: C0116: Missing function or method docstring (missing-function-docstring)
basic_functions.py:9:14: W0613: Unused argument 'samples' (unused-argument)
basic_functions.py:13:0: C0116: Missing function or method docstring (missing-function-docstring)
basic_functions.py:13:12: W0613: Unused argument 'samples' (unused-argument)
************* Module basic_functions_solution
basic_functions_solution.py:5:0: C0325: Unnecessary parens after 'return' keyword (superfluous-parens)
basic_functions_solution.py:1:0: C0114: Missing module docstring (missing-module-docstring)
basic_functions_solution.py:1:0: C0116: Missing function or method docstring (missing-function-docstring)
basic_functions_solution.py:2:4: C0103: Variable name "mu" doesn't conform to snake_case naming style (invalid-name)
basic_functions_solution.py:4:8: C0103: Variable name "mu" doesn't conform to snake_case naming style (invalid-name)
basic_functions_solution.py:8:0: C0116: Missing function or method docstring (missing-function-docstring)
basic_functions_solution.py:10:4: C0103: Variable name "mu" doesn't conform to snake_case naming style (invalid-name)
basic_functions_solution.py:16:0: C0116: Missing function or method docstring (missing-function-docstring)
basic_functions_solution.py:28:0: C0116: Missing function or method docstring (missing-function-docstring)
------------------------------------------------------------------
Your code has been rated at 4.71/10 (previous run: 4.71/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/02-Statistics-Probabilities/01-Mean-Mode-Median-Std
collecting ... collected 4 items
tests/test_basic_functions.py::TestBasicFunctions::test_my_mean FAILED [ 25%]
tests/test_basic_functions.py::TestBasicFunctions::test_my_median FAILED [ 50%]
tests/test_basic_functions.py::TestBasicFunctions::test_my_mode FAILED [ 75%]
tests/test_basic_functions.py::TestBasicFunctions::test_my_standard_deviation FAILED [100%]
=================================== FAILURES ===================================
_______________________ TestBasicFunctions.test_my_mean ________________________
self = <tests.test_basic_functions.TestBasicFunctions testMethod=test_my_mean>
def test_my_mean(self):
test1 = [5, 7, 2, 2, 7, 9, 30, 20, 2, 6, 44, 44, 4, 4, 225]
> self.assertEqual(my_mean(test1), statistics.mean(test1))
E AssertionError: None != 27.4
tests/test_basic_functions.py:11: AssertionError
______________________ TestBasicFunctions.test_my_median _______________________
self = <tests.test_basic_functions.TestBasicFunctions testMethod=test_my_median>
def test_my_median(self):
test1 = [5, 7, 2, 2, 7, 9, 30, 20, 2, 6, 44, 44, 4, 4, 225]
> self.assertEqual(my_median(test1), statistics.median(test1))
E AssertionError: None != 7
tests/test_basic_functions.py:19: AssertionError
_______________________ TestBasicFunctions.test_my_mode ________________________
self = <tests.test_basic_functions.TestBasicFunctions testMethod=test_my_mode>
def test_my_mode(self):
test1 = [5, 7, 2, 2, 7, 9, 30, 20, 2, 6, 44, 44, 4, 4, 225]
> self.assertEqual(my_mode(test1), statistics.mode(test1))
E AssertionError: None != 2
tests/test_basic_functions.py:27: AssertionError
________________ TestBasicFunctions.test_my_standard_deviation _________________
self = <tests.test_basic_functions.TestBasicFunctions testMethod=test_my_standard_deviation>
def test_my_standard_deviation(self):
test1 = [5, 7, 2, 2, 7, 9, 30, 20, 2, 6, 44, 44, 4, 4, 225]
> self.assertEqual(my_standard_deviation(test1), statistics.stdev(test1))
E AssertionError: None != 56.58091551044397
tests/test_basic_functions.py:15: AssertionError
=========================== short test summary info ============================
FAILED tests/test_basic_functions.py::TestBasicFunctions::test_my_mean - Asse...
FAILED tests/test_basic_functions.py::TestBasicFunctions::test_my_median - As...
FAILED tests/test_basic_functions.py::TestBasicFunctions::test_my_mode - Asse...
FAILED tests/test_basic_functions.py::TestBasicFunctions::test_my_standard_deviation
============================== 4 failed in 0.16s ===============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/02-Statistics-Probabilities/03-Central-Limit-Theorem
collecting ... collected 12 items
tests/test_distribution.py::TestDistribution::test_mean_is_a_float PASSED [ 8%]
tests/test_distribution.py::TestDistribution::test_mean_value PASSED [ 16%]
tests/test_distribution.py::TestDistribution::test_skewness_is_right PASSED [ 25%]
tests/test_distribution.py::TestDistribution::test_standard_deviation_is_a_float PASSED [ 33%]
tests/test_distribution.py::TestDistribution::test_standard_deviation_value PASSED [ 41%]
tests/test_probability.py::TestProbability::test_mu_expected_is_mu PASSED [ 50%]
tests/test_probability.py::TestProbability::test_probability_is_valid PASSED [ 58%]
tests/test_probability.py::TestProbability::test_probability_is_very_low PASSED [ 66%]
tests/test_probability.py::TestProbability::test_sigma_expected_value PASSED [ 75%]
tests/test_zscore.py::TestZscore::test_probability_is_valid PASSED [ 83%]
tests/test_zscore.py::TestZscore::test_probability_is_very_low PASSED [ 91%]
tests/test_zscore.py::TestZscore::test_z_score_value PASSED [100%]
============================== 12 passed in 0.14s ==============================
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true
************* Module comparison
comparison.py:6:0: C0301: Line too long (116/100) (line-too-long)
comparison.py:10:11: C0103: Variable name "v" doesn't conform to snake_case naming style (invalid-name)
comparison.py:10:11: W0612: Unused variable 'v' (unused-variable)
************* Module flip_coin_factorial
flip_coin_factorial.py:21:0: C0305: Trailing newlines (trailing-newlines)
flip_coin_factorial.py:8:4: W0101: Unreachable code (unreachable)
flip_coin_factorial.py:8:4: W0107: Unnecessary pass statement (unnecessary-pass)
************* Module simulate_reality
simulate_reality.py:9:8: W0612: Unused variable 'i' (unused-variable)
------------------------------------------------------------------
Your code has been rated at 8.16/10 (previous run: 8.16/10, +0.00)
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/02-Statistics-Probabilities/02-Toss-a-Coin
collecting ... collected 22 items
tests/test_flip_coin_factorial.py::TestTheory::test_count_possibilities_11 PASSED [ 4%]
tests/test_flip_coin_factorial.py::TestTheory::test_count_possibilities_42 PASSED [ 9%]
tests/test_flip_coin_factorial.py::TestTheory::test_count_possibilities_43 PASSED [ 13%]
tests/test_flip_coin_factorial.py::TestTheory::test_count_possibilities_44 PASSED [ 18%]
tests/test_flip_coin_factorial.py::TestTheory::test_count_total_possibilities_1 PASSED [ 22%]
tests/test_flip_coin_factorial.py::TestTheory::test_count_total_possibilities_10 PASSED [ 27%]
tests/test_flip_coin_factorial.py::TestTheory::test_count_total_possibilities_2 PASSED [ 31%]
tests/test_flip_coin_factorial.py::TestTheory::test_count_total_possibilities_6 PASSED [ 36%]
tests/test_flip_coin_factorial.py::TestTheory::test_probability_1 PASSED [ 40%]
tests/test_flip_coin_factorial.py::TestTheory::test_probability_100 PASSED [ 45%]
tests/test_flip_coin_factorial.py::TestTheory::test_probability_4 PASSED [ 50%]
tests/test_mse.py::TestMSE::test_mean_squared_error_100 PASSED [ 54%]
tests/test_mse.py::TestMSE::test_mean_squared_error_1000 PASSED [ 59%]
tests/test_mse.py::TestMSE::test_mean_squared_error_10000 PASSED [ 63%]
tests/test_mse.py::TestMSE::test_mean_squared_error_3 PASSED [ 68%]
tests/test_simulate_reality.py::TestReality::test_play_n_game_1 PASSED [ 72%]
tests/test_simulate_reality.py::TestReality::test_play_n_game_100 PASSED [ 77%]
tests/test_simulate_reality.py::TestReality::test_play_n_game_1000 PASSED [ 81%]
tests/test_simulate_reality.py::TestReality::test_play_one_game_1 PASSED [ 86%]
tests/test_simulate_reality.py::TestReality::test_play_one_game_10 PASSED [ 90%]
tests/test_simulate_reality.py::TestReality::test_play_one_game_100 PASSED [ 95%]
tests/test_simulate_reality.py::TestReality::test_play_one_game_1000 PASSED [100%]
============================== 22 passed in 1.26s ==============================
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/05-ML/04-Under-the-hood/02-Solvers
collecting ... collected 3 items
tests/test_new_data_prediction.py::TestNewDataPrediction::test_predicted_class PASSED [ 33%]
tests/test_new_data_prediction.py::TestNewDataPrediction::test_predicted_proba PASSED [ 66%]
tests/test_solvers.py::TestSolvers::test_fastest_solver PASSED [100%]
============================== 3 passed in 0.13s ===============================
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/05-ML/04-Under-the-hood/03-Batch-Gradient-Descent
collecting ... collected 2 items
tests/test_descent.py::TestDescent::test_a PASSED [ 50%]
tests/test_descent.py::TestDescent::test_b PASSED [100%]
============================== 2 passed in 0.12s ===============================
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes
============================= test session starts ==============================
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/python@3.9/bin/python3.9
cachedir: .pytest_cache
rootdir: /Users/andybarnov/code/lewagon/data-solutions/05-ML/04-Under-the-hood/01-Loss-Functions
collecting ... collected 3 items
tests/test_loss_functions.py::TestLossFunctions::test_max_error_order PASSED [ 33%]
tests/test_loss_functions.py::TestLossFunctions::test_r2 PASSED [ 66%]
tests/test_loss_functions.py::TestLossFunctions::test_r2_mae PASSED [100%]
============================== 3 passed in 0.12s ===============================
#!/bin/sh
set -ux
for file in $(find . -type d -exec test -e '{}'/Makefile \; -print)
do
make -C "$file";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment