code: def test_invalid_sub():
      # Quantity with negative difference
      q1 = Quantity(BTC, 500)
      q2 = Quantity(BTC, 1000)
      with pytest.raises(InvalidNegativeQuantity):
          q = q1 - q2
  
      # Quantity with different instruments
      q1 = Quantity(BTC, 500)
      q2 = Quantity(ETH, 1000)
      with pytest.raises(IncompatibleInstrumentOperation):
          q = q1 - q2
  
      # Quantity with different Path IDs
      q1 = Quantity(BTC, 1000, path_id=path_id)
      q2 = Quantity(BTC, 500, path_id=other_id)
      with pytest.raises(QuantityOpPathMismatch):
          q = q1 - q2
  
      # int
      q1 = Quantity(BTC, 500)
      q2 = 1000
      with pytest.raises(InvalidNegativeQuantity):
          q = q1 - q2
  
      # float
      q1 = Quantity(BTC, 500)
      q2 = 1000.0
      with pytest.raises(InvalidNegativeQuantity):
          q = q1 - q2
  
      # Not a number
      q1 = Quantity(BTC, 500)
      q2 = "ETH"
      with pytest.raises(InvalidNonNumericQuantity):
          q = q1 - q2
  
imports: import pytest
  import unittest.mock
  from tensortrade.oms.instruments import *
  from tensortrade.core.exceptions import *
label_desc: Use image node_id 9 for calling a global function with example usage: test_invalid_sub() without return types