avatar Bite 166. Complete a tox ini file parser class

The INI file format is an informal standard for configuration files for some platforms or software. (Wikipedia).

In this Bite you will use configparser to parse a tox ini file.

Complete the ToxIniParser class, completing the stub properties making the tests happy.

Eh properties? No worries, check out our article and YouTube video.

See the TESTS tab. There is a lot of ini file data, so scroll down to the actual tests ...

Additionally here is how it would work in the Python REPL using a copy of Django's tox ini file saved to my local /tmp folder:

  >>> from ini import ToxIniParser
  >>> tox = ToxIniParser('/tmp/django-tox.ini')
  >>> tox.number_of_sections
  7
  >>> tox.environments
  ['py3', 'flake8', 'docs', 'isort']
  >>> tox.base_python_versions
  ['python3']

Good luck and keep calm and code in Python!

Login and get coding
go back Intermediate level
Bitecoin 3X

214 out of 226 users completed this Bite.
Will you be Pythonista #215 to crack this Bite?
Resolution time: ~93 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 6.31 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help