Set up python project:

- I don't use approval testing, as I like to feel closer to the code whilst testing and for tests to be self contained and not rely on external data that has to be kept up to date and bloats the directory structure.
  - I like to use pdm to manage venvs, dependancies and scripts with one modern tool.
  - I bumped the version number for my version.
  - This is an exercise, no reason to have multiple dependency lists.
  - I find pytest and the plugin easier to use and a threshold helpful.  Unittest adds unnecessary boilerplate code.
  - conftest not needed atm
  - Module level comments are helpful.
  - Use linting, type checking and formatting tools - good practice.
  - Update readme given alterations.
  - Update gitignore to new python environment

N.B.  linting errors left until tests in place.
This commit is contained in:
Simon Fothergill committed 2026-09-15 20:51:56 +01:00
1 parent d6407909c7
commit 39ce08d5ea
12 files changed
+1011 -119

No files matched your search

+8 -10
View File
@@ -1,16 +1,14 @@
# -*- coding: utf-8 -*-
import unittest
# This module is to provide all tests necessary for refactoring
from gilded_rose import Item, GildedRose
class GildedRoseTest(unittest.TestCase):
def test_foo(self):
items = [Item("foo", 0, 0)]
gilded_rose = GildedRose(items)
gilded_rose.update_quality()
self.assertEqual("fixme", items[0].name)
def test_foo():
items = [Item("foo", 0, 0)]
gilded_rose = GildedRose(items)
gilded_rose.update_quality()
if __name__ == '__main__':
unittest.main()
assert "fixme" == items[0].name