Traceback (most recent call last):
File "./pokemon", line 298, in <module>
main(sys.argv)
File "./pokemon", line 288, in main
single_argument_handler(argv[1].lower(), ESCAPE_CODE)
File "./pokemon", line 240, in single_argument_handler
change_terminal_background(db, db.get_light().get_name())
AttributeError: 'str' object has no attribute 'get_name'
Traceback (most recent call last):
File "./pokemon", line 298, in <module>
main(sys.argv)
File "./pokemon", line 288, in main
single_argument_handler(argv[1].lower(), ESCAPE_CODE)
File "./pokemon", line 270, in single_argument_handler
change_terminal_background(db, arg)
File "./pokemon", line 123, in change_terminal_background
scripter.change_terminal(pokemon.get_path())
File "/Users/Laki/Documents/GitHub/Pokemon-Terminal/scripter.py", line 41, in change_terminal
adapter.set_pokemon(image_file_path)
AttributeError: 'ITerm' object has no attribute 'set_pokemon'
Creating two instance of the Database class throws `Exception: Duplicate names detected.`
You can see this by running the code:
```python
db0 = Database() # create the fist db... no problems
db1 = Database() # Exception: Duplicate names detected
```
This is caused because all instances of a class share each class level variable so when db1 wants to add a pokemon to the list, it sees that db0 has already added it. Class-level variables are good for constants but in general should be avoided for things that get modified at runtime unless shared state between all instances is desireable.
This is a problem because pytest will create multiple databases as it sets up, executes, and tears down tests various aspects of the app. The cleanest fix to this problem that I can think of is to demote the list and dict from being class level to being instance level. This way each instance has its own separate copy and we reduce shared state