Skip to content

Dinones/Unit-Tests

Repository files navigation

⠀Unit Tests Submodule

This repository is designed to be used as a submodule where I create unit tests for my projects.

To run unit tests more visual in VS Code, you need to install the Python extension. Then, press Ctrl+Shift+P to open the Command Palette. Type "Python: Configure Tests" and select it. Choose the unittest testing framework, and follow the prompts to configure the test folder and file pattern.

After completing the configuration, a Testing icon will appear in the Activity Bar on the left. If it doesn’t, right-click on the sidebar and enable it.

⠀How to Use Submodules

  • Clone Main Repository Including Submodules

    git clone --recurse-submodules <main-repo-url>

    If you have already cloned the repository without the --recurse-submodules option, it can still be initialized by running:

    git submodule update --init --remote --merge

    Or:

    git submodule init
    git submodule update
  • Check Submodules Version

    git submodule status
  • Update Submodules

    If changes are made to this repository, developers will need to pull them by running:

    git submodule update --remote
  • Committing Changes to the Submodule Repository

    If a developer modifies the submodule, they need to commit the changes in this repository and then commit the updated submodule reference in the main project:

    • Inside the submodule directory:

      git add <new-files>
      git commit -m "Updated submodule"
    • Then, in the main project directory:

      git add <submodule-folder>
      git commit -m "Updated Tests submodule"

    If you try to commit from the main project directory without committing the submodule first, you will see a message like this:

    warning: not adding submodule <submodule-folder>

    And the changes will not be commited to this repository. Submodules in Git are independent repositories, meaning that when you modify files within a submodule, Git will not automatically track these changes when you're in the main project directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages