Coder Social home page Coder Social logo

Comments (3)

bpepple avatar bpepple commented on August 30, 2024

Couple of ways to solve this, one is to make your configparser not use a hard-coded file location. You then could create a test-config to use when running test. The second option would Mock any values needed to run the tests. Without seeing the GH failure logs, and I'm not sure which route is better solution.

from dex-starr.

Buried-In-Code avatar Buried-In-Code commented on August 30, 2024

After taking a closer look at how I implemented the tests rather than loading a test config, they try and load it how Comic-Organizer would for any user.
After thinking about it, i dont need to have it implemented that way and should instead pass the values to the tests via Environment variables, like you do for Mokkari tests.

from dex-starr.

bpepple avatar bpepple commented on August 30, 2024

After taking a closer look at how I implemented the tests rather than loading a test config, they try and load it how Comic-Organizer would for any user.

Really, I'd say this is actually a bug that was exposed.

By hard-coding a config file location without any type of error handling you're making this section of the code fairly brittle. A better solution would be to gracefully exit if the file isn't found, or to create an empty file and then error out if any info is missing when needed. Really all those variables (COMICVINE_API_KEY, LEAGUE_API_KEY, etc) should be using default values (None, "", etc) if for some reason their keys are not in config file.

There are a lot of different ways to implement this depending on your needs, for most of my simple projects I tend to use something like this:

https://github.com/bpepple/metron-tagger/blob/master/metrontagger/taggerlib/settings.py

Anyway, something to think about.

from dex-starr.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.